Message76780
Note that the display is correct in the case where the chaining is
"right", i.e.:
try:
raise IOError
except:
try:
raise KeyError
except Exception as ex:
raise AttributeError from ex
In that case, IOError is correctly flagged as the original exception,
with a KeyError then occurring during the IOError handling, and the
KeyError then directly causing the AttributeError.
The weird thing I am doing in the example here is to set the __cause__
of the exception I am raising to an exception that was never itself
actually raised (the "from KeyError" bit). |
|
Date |
User |
Action |
Args |
2008-12-02 20:49:55 | ncoghlan | set | recipients:
+ ncoghlan, barry, pitrou |
2008-12-02 20:49:55 | ncoghlan | set | messageid: <1228250995.19.0.0372480075812.issue4486@psf.upfronthosting.co.za> |
2008-12-02 20:49:54 | ncoghlan | link | issue4486 messages |
2008-12-02 20:49:54 | ncoghlan | create | |
|