Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1138944

Browse files
committed
only incref when using borrowing functions
1 parent aed9773 commit 1138944

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
@@ -2132,6 +2132,7 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
21322132
GLOBAL_NAME_ERROR_MSG, w);
21332133
break;
21342134
}
2135+
Py_INCREF(x);
21352136
}
21362137
else {
21372138
/* Slow-path if globals or builtins is not a dict */
@@ -2147,7 +2148,6 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
21472148
}
21482149
}
21492150
}
2150-
Py_INCREF(x);
21512151
PUSH(x);
21522152
DISPATCH();
21532153

0 commit comments

Comments
 (0)