Skip to content

Commit 777838a

Browse files
Fix a refcount.
1 parent a797883 commit 777838a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Modules/_interpretersmodule.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,7 @@ _run_script(PyInterpreterState *interp, const char *codestr,
271271
if (main_mod == NULL)
272272
return -1;
273273
PyObject *ns = PyModule_GetDict(main_mod); // borrowed
274+
Py_INCREF(ns);
274275
Py_DECREF(main_mod);
275276
if (ns == NULL)
276277
return -1;

0 commit comments

Comments
 (0)