Message288108
I've been looking into this further, and a reproducer that's independent of assertRaises() is to just bind the function to a local variable name in an outer function:
def outer():
callable_obj = f
try:
callable_obj()
except Exception as exc:
return exc
That should make it easier to test a basic recursive "clear_all_frames" operation like:
def clear_all_frames(exc):
cause = exc.__cause__
if cause is not None:
clear_all_frames(cause)
context = exc.__context__
if context is not None:
clear_all_frames(context)
traceback.clear_frames(exc.__traceback__) |
|
Date |
User |
Action |
Args |
2017-02-19 05:55:16 | ncoghlan | set | recipients:
+ ncoghlan, vstinner, rbcollins, ezio.melotti, r.david.murray, michael.foord, docs@python, Vjacheslav.Fyodorov, subho |
2017-02-19 05:55:16 | ncoghlan | set | messageid: <1487483716.05.0.864910383037.issue23890@psf.upfronthosting.co.za> |
2017-02-19 05:55:16 | ncoghlan | link | issue23890 messages |
2017-02-19 05:55:15 | ncoghlan | create | |
|