From: Benjamin Peterson Date: Thu, 26 Apr 2012 04:26:37 +0000 (-0400) Subject: only incref when using borrowing functions X-Git-Tag: v3.3.0a3~74 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1138944888d13d2600241ca0d9408e018077d691;p=python only incref when using borrowing functions --- diff --git a/Python/ceval.c b/Python/ceval.c index a4e5a327df..b9a006b675 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -2132,6 +2132,7 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag) GLOBAL_NAME_ERROR_MSG, w); break; } + Py_INCREF(x); } else { /* Slow-path if globals or builtins is not a dict */ @@ -2147,7 +2148,6 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag) } } } - Py_INCREF(x); PUSH(x); DISPATCH();