Nick Coghlan added the comment:

This isn't a bug, as "raise exc from None" only hides *display* of the context, 
it doesn't lose the record of the context entirely.

This means Walter's display code is incorrect, as it isn't checking for 

>>> import inspect
>>> try:
...     inspect.signature(lambda x:None).bind()
... except Exception as e:
...     exc = e
>>> exc.__suppress_context__

Interestingly, neither PEP 409 *nor* PEP 415 capture the rationale for that 
design: retaining the full context data even when it's hidden by the default 
exception display routines means that you can still debug code that uses "raise 
X from None" inappropriately. (I thought there was an open RFE to make it easy 
to force the traceback module to ignore __suppress_context__ but if there is 
one, I can't find it)

resolution:  -> not a bug
stage: patch review -> resolved
status: open -> closed

Python tracker <>
Python-bugs-list mailing list

Reply via email to