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

Serhiy Storchaka report at bugs.python.org
Sun Sep 16 10:39:02 EDT 2018


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

Humm, the optimization is not related here. Even if it is not involved (replace 17 with []), the line 4 is reported twice, because RETURN_VALUE is executed after CALL_FINALLY.

  4          10 BUILD_LIST               0
             12 POP_BLOCK
             14 CALL_FINALLY             2 (to 18)
             16 RETURN_VALUE

In 3.7 RETURN_VALUE was the opcode executed at line 4. The stack of blocks was unwinded at interpreted loop implicitly when execute RETURN_VALUE. But in 3.8 calling the finally code is explicit.

----------
nosy: +Mark.Shannon

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


More information about the Python-bugs-list mailing list