]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.13] gh-122728: Fix SystemError in PyEval_GetLocals() (GH-122735) (#122757)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 6 Aug 2024 21:37:10 +0000 (23:37 +0200)
committerGitHub <noreply@github.com>
Tue, 6 Aug 2024 21:37:10 +0000 (23:37 +0200)
commit5c161cb8329c941aa219dc34c56afa368516d6fb
tree819abfe98db80b0e0f776c05e8211adac5e6319e
parente808146af1841abc7d5f86470041d3ef7712050e
[3.13] gh-122728: Fix SystemError in PyEval_GetLocals() (GH-122735) (#122757)

gh-122728: Fix SystemError in PyEval_GetLocals() (GH-122735)

Fix PyEval_GetLocals() to avoid SystemError ("bad argument to
internal function"). Don't redefine the 'ret' variable in the if
block.

Add an unit test on PyEval_GetLocals().
(cherry picked from commit 4767a6e31c0550836b2af45d27e374e721f0c4e6)

Co-authored-by: Victor Stinner <vstinner@python.org>
Lib/test/test_capi/test_misc.py
Misc/NEWS.d/next/C_API/2024-08-06-14-23-11.gh-issue-122728.l-fQ-v.rst [new file with mode: 0644]
Modules/_testcapimodule.c
Python/ceval.c