Eric V. Smith <e...@trueblade.com> added the comment:

Yes, this is a known issue.

See https://docs.python.org/3/reference/compound_stmts.html#the-try-statement, 
in particular the sentence "When an exception has been assigned using as 
target, it is cleared at the end of the except clause" and the following text.

Basically, at the end of the exception block python does a "del err" in order 
to prevent a long-lived reference cycle including the exception.

----------
nosy: +eric.smith
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed
type:  -> behavior

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue39841>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to