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 Saim Raza
Recipients Saim Raza, SilentGhost, barry, xdegaye
Date 2019-04-06.21:52:05
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1554587526.12.0.387205777765.issue36537@roundup.psfhosted.org>
In-reply-to
Content
https://docs.python.org/3/reference/compound_stmts.html#the-try-statement says

=============
except E as N:
    foo
=============

is converted to the following statement:

=============
except E as N:
    try:
        foo
    finally:
        del N
=============

In the examples in this thread, foo is 'import pdb; pdb.set_trace()'. So, I was expecting 'del N' to be executed only after executing foo. This implies that err should have been available in the scope.

Further, isn't the code execution supposed to be stopped at the set_trace() line and not on the next line. Should it at least respect the scope (indentation) and not execute the '--Return--' line event until the user actually executes the next line (x=1 in your example)?
History
Date User Action Args
2019-04-06 21:52:06Saim Razasetrecipients: + Saim Raza, barry, SilentGhost, xdegaye
2019-04-06 21:52:06Saim Razasetmessageid: <1554587526.12.0.387205777765.issue36537@roundup.psfhosted.org>
2019-04-06 21:52:06Saim Razalinkissue36537 messages
2019-04-06 21:52:05Saim Razacreate