This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ncoghlan
Recipients barry, ncoghlan, pitrou
Date 2008-12-02.20:49:53
SpamBayes Score 0.004130859
Marked as misclassified No
Message-id <1228250995.19.0.0372480075812.issue4486@psf.upfronthosting.co.za>
In-reply-to
Content
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).
History
Date User Action Args
2008-12-02 20:49:55ncoghlansetrecipients: + ncoghlan, barry, pitrou
2008-12-02 20:49:55ncoghlansetmessageid: <1228250995.19.0.0372480075812.issue4486@psf.upfronthosting.co.za>
2008-12-02 20:49:54ncoghlanlinkissue4486 messages
2008-12-02 20:49:54ncoghlancreate