◐ Shell
clean mode source ↗

gh-98257: Make _PyEval_SetTrace() reentrant by vstinner · Pull Request #98258 · python/cpython

Make sys.setprofile() and sys.settrace() functions reentrant.  They
can no long fail with: RuntimeError("Cannot install a trace function
while another trace function is being installed").

Make _PyEval_SetTrace() and _PyEval_SetProfile() functions reentrant,
rather than detecting and rejecting reentrant calls. Only delete the
reference to function arguments once the new function is fully set,
when a reentrant call is safe. Call also _PySys_Audit() earlier.

@vstinner

JelleZijlstra

pablogsal

carljm added a commit to carljm/cpython that referenced this pull request

Oct 20, 2022