From: Guido van Rossum Date: Thu, 22 Oct 1998 15:46:50 +0000 (+0000) Subject: Jim Fulton writes: X-Git-Tag: v1.5.2b1~282 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=66468568df6e9e56b914b15f36dc091f81117150;p=python 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. """ --- diff --git a/Python/import.c b/Python/import.c index 0bf5d47cfb..2707019414 100644 --- a/Python/import.c +++ b/Python/import.c @@ -1858,6 +1858,7 @@ PyImport_Import(module_name) /* 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;