Improper Backtraces in Exec'd Code

Burton Samograd burton at userful.com
Thu Jul 22 13:48:38 EDT 2010


Peter Otten <__peter__ at web.de> writes:

<snip>

> If you make the compilation step explicit you can pass a filename:
>
>>>> exec compile("def f(x): return f(x-1) if x else 1/0", "yadda.py", 
> "exec")

The works great. Problem solved. Thanks.

--
Burton Samograd




More information about the Python-list mailing list