Commit 5c161cb
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 4767a6e)
Co-authored-by: Victor Stinner <vstinner@python.org>
1 parent e808146 commit 5c161cb
File tree
4 files changed
+23
-1
lines changed- Lib/test/test_capi
- Misc/NEWS.d/next/C_API
- Modules
- Python
4 files changed
+23
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1180 | 1180 | | |
1181 | 1181 | | |
1182 | 1182 | | |
| 1183 | + | |
| 1184 | + | |
| 1185 | + | |
| 1186 | + | |
| 1187 | + | |
| 1188 | + | |
| 1189 | + | |
| 1190 | + | |
| 1191 | + | |
| 1192 | + | |
| 1193 | + | |
| 1194 | + | |
| 1195 | + | |
1183 | 1196 | | |
1184 | 1197 | | |
1185 | 1198 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3332 | 3332 | | |
3333 | 3333 | | |
3334 | 3334 | | |
| 3335 | + | |
| 3336 | + | |
| 3337 | + | |
| 3338 | + | |
| 3339 | + | |
| 3340 | + | |
3335 | 3341 | | |
3336 | 3342 | | |
3337 | 3343 | | |
| |||
3476 | 3482 | | |
3477 | 3483 | | |
3478 | 3484 | | |
| 3485 | + | |
3479 | 3486 | | |
3480 | 3487 | | |
3481 | 3488 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2482 | 2482 | | |
2483 | 2483 | | |
2484 | 2484 | | |
2485 | | - | |
| 2485 | + | |
2486 | 2486 | | |
2487 | 2487 | | |
2488 | 2488 | | |
| |||
0 commit comments