Re: Traceback spoofing

2010-05-21 Thread Zac Burns
> Except you can't re-raise them. > Yes, I should have noted that in the original post: >>> raise RuntimeError, 'X', wrapped_traceback Traceback (most recent call last): File "", line 1, in TypeError: raise: arg 3 must be a traceback or None Does someone know where the thread went about it b

Re: Traceback spoofing

2010-05-21 Thread exarkun
On 01:42 am, tjre...@udel.edu wrote: On 5/21/2010 7:22 PM, Zac Burns wrote: Why can't I inherit from traceback to 'spoof' tracebacks? Because a) they are, at least in part, an internal implementation detail of CPython, But you can just say this about anything, since there is no Python spec

Re: Traceback spoofing

2010-05-21 Thread Terry Reedy
On 5/21/2010 7:22 PM, Zac Burns wrote: Why can't I inherit from traceback to 'spoof' tracebacks? Because a) they are, at least in part, an internal implementation detail of CPython, and b) even if you could, Python would use the builtin original with exceptions, and c) you can probably do any

Traceback spoofing

2010-05-21 Thread Zac Burns
Why can't I inherit from traceback to 'spoof' tracebacks? I would like to create a traceback that is save-able to re-raise exceptions later without leaking all the locals. (I'm sure this idea has been discussed before but I can't find it anymore.) class Traceback(types.TracebackType): pass TypeErr