Skip to content

Commit 07f75da

Browse files
cmaloneyclaude
andcommitted
Only touch the new frame when passing something through
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 119e8df commit 07f75da

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎Python/ceval.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2196,7 +2196,7 @@ _PyEvalFramePushAndInit_Ex(PyThreadState *tstate, _PyStackRef func,
21962196
/* No need to decref func here because the reference has been stolen by
21972197
_PyEvalFramePushAndInit.
21982198
*/
2199-
if (new_frame != NULL) {
2199+
if ((pass_args || pass_kwargs) && new_frame != NULL) {
22002200
_PyStackRef *local = &new_frame->localsplus[co->co_argcount
22012201
+ co->co_kwonlyargcount];
22022202
if (pass_args) {

0 commit comments

Comments
 (0)