]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-39114: Fix tracing of except handlers with name binding (GH-17769)
authorPablo Galindo <Pablogsal@gmail.com>
Thu, 2 Jan 2020 11:38:44 +0000 (11:38 +0000)
committerGitHub <noreply@github.com>
Thu, 2 Jan 2020 11:38:44 +0000 (11:38 +0000)
commit04ec7a1f7a5b92187a73cd02670958444c6f2220
treedf7e34cd5c5ef3e80ce51ab6c6ad85dba37de8e0
parent149175c6dfc8455023e4335575f3fe3d606729f9
bpo-39114: Fix tracing of except handlers with name binding (GH-17769)

When producing the bytecode of exception handlers with name binding (like `except Exception as e`) we need to produce a try-finally block to make sure that the name is deleted after the handler is executed to prevent cycles in the stack frame objects. The bytecode associated with this try-finally block does not have source lines associated and it was causing problems when the tracing functionality was running over it.
Lib/test/test_sys_settrace.py
Misc/NEWS.d/next/Core and Builtins/2019-12-31-18-25-45.bpo-39114.WG9alt.rst [new file with mode: 0644]
Python/ceval.c