Skip to content

Commit bd0c357

Browse files
committed
fixes
1 parent 2fae889 commit bd0c357

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Python/bltinmodule.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -927,6 +927,9 @@ builtin_eval_impl(PyObject *module, PyObject *source, PyObject *globals,
927927
if (locals == NULL)
928928
return NULL;
929929
}
930+
else {
931+
Py_INCREF(locals);
932+
}
930933
}
931934
else if (locals == Py_None)
932935
locals = Py_NewRef(globals);
@@ -1016,6 +1019,9 @@ builtin_exec_impl(PyObject *module, PyObject *source, PyObject *globals,
10161019
if (locals == NULL)
10171020
return NULL;
10181021
}
1022+
else {
1023+
Py_INCREF(locals);
1024+
}
10191025
if (!globals || !locals) {
10201026
PyErr_SetString(PyExc_SystemError,
10211027
"globals and locals cannot be NULL");
@@ -1736,8 +1742,6 @@ static PyObject *
17361742
builtin_locals_impl(PyObject *module)
17371743
/*[clinic end generated code: output=b46c94015ce11448 input=7874018d478d5c4b]*/
17381744
{
1739-
PyObject *d;
1740-
17411745
return PyEval_GetFrameLocals();
17421746
}
17431747

0 commit comments

Comments
 (0)