Nick Coghlan <[EMAIL PROTECTED]> added the comment:

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).

_______________________________________
Python tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue4486>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to