Saim Raza <saimors...@gmail.com> added the comment:

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

----------

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

Reply via email to