[issue34705] Python 3.8 changes how returns through finally clauses are traced

Mark Shannon report at bugs.python.org
Wed Jan 13 11:20:06 EST 2021


Mark Shannon <mark at hotpy.org> added the comment:

In master, the sequence of events is:

1 call
2 line
3 line
returning
4 line
6 line
finally
6 return

which is the same as 3.7.
I now believe this is the correct trace, as the language spec states:

When a return, break or continue statement is executed in the try suite of a try…finally statement, the finally clause is also executed ‘on the way out.’

So line 6 should be last line traced.

----------
resolution:  -> fixed
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue34705>
_______________________________________


More information about the Python-bugs-list mailing list