En Wed, 07 Nov 2007 01:53:31 -0300, [EMAIL PROTECTED]
[EMAIL PROTECTED] escribió:
This works great except for syntax errors. Any idea why your solution
doesn't catch those?
Here's the output it gives me, followed by the code I'm using (running
in Python 2.5):
Traceback (most recent call
On Sep 12, 10:35 am, Peter Otten [EMAIL PROTECTED] wrote:
Am Wed, 12 Sep 2007 15:09:02 + schrieb [EMAIL PROTECTED]:
On Sep 12, 5:17 am, Peter Otten [EMAIL PROTECTED] wrote:
Your assessment is wrong. You only get the extra lines in the traceback if
you don't immediately wrap the exec
Am Wed, 12 Sep 2007 02:09:28 + schrieb [EMAIL PROTECTED]:
I'm running code via the exec in context statement within a much
larger program. What I would like to do is capture any possible
errors and show a pretty traceback just like the Python interactive
interpreter does, but only show
[EMAIL PROTECTED] wrote:
I'm running code via the exec in context statement within a much
larger program. What I would like to do is capture any possible
errors and show a pretty traceback just like the Python interactive
interpreter does, but only show the part of the traceback relating to
Am Wed, 12 Sep 2007 11:21:48 +0200 schrieb Michael Ströder:
[EMAIL PROTECTED] wrote:
I'm running code via the exec in context statement within a much
larger program. What I would like to do is capture any possible
errors and show a pretty traceback just like the Python interactive
On Sep 12, 5:17 am, Peter Otten [EMAIL PROTECTED] wrote:
Your assessment is wrong. You only get the extra lines in the traceback if
you don't immediately wrap the exec statement in a try ... except block:
$ cat snip_traceback1.py
import traceback
def alpha():
try:
beta()
Am Wed, 12 Sep 2007 15:09:02 + schrieb [EMAIL PROTECTED]:
On Sep 12, 5:17 am, Peter Otten [EMAIL PROTECTED] wrote:
Your assessment is wrong. You only get the extra lines in the traceback if
you don't immediately wrap the exec statement in a try ... except block:
$ cat snip_traceback3.py
On Sep 12, 11:35 am, Peter Otten [EMAIL PROTECTED] wrote:
Am Wed, 12 Sep 2007 15:09:02 + schrieb [EMAIL PROTECTED]:
On Sep 12, 5:17 am, Peter Otten [EMAIL PROTECTED] wrote:
Your assessment is wrong. You only get the extra lines in the traceback if
you don't immediately wrap the exec
I'm running code via the exec in context statement within a much
larger program. What I would like to do is capture any possible
errors and show a pretty traceback just like the Python interactive
interpreter does, but only show the part of the traceback relating to
the code sent to exec.
For