Mercurial > cpython-lru_cache-weakref
diff Python/import.c @ 9431:87b9554c51d4 legacy-trunk
Jim Fulton writes:
"""
I had originally not realized that PyEval_GetGlobals did not
INCREF it's return value. The fix is to add the INCREF,
as shown below.
"""
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Thu, 22 Oct 1998 15:46:50 +0000 |
| parents | 7f242f29a45f |
| children | 877d23bd5bdc |
line wrap: on
line diff
--- a/Python/import.c Thu Oct 22 15:08:00 1998 +0000 +++ b/Python/import.c Thu Oct 22 15:46:50 1998 +0000 @@ -1858,6 +1858,7 @@ /* Get the builtins from current globals */ globals = PyEval_GetGlobals(); if(globals != NULL) { + Py_INCREF(globals); builtins = PyObject_GetItem(globals, builtins_str); if (builtins == NULL) goto err;
