In PySys_GetObject(), it's possible that tstate->interp->sysdict is

NULL.  In that case, return NULL rather than dumping core.

This fixes PR#91, submitted by Lele Gaifax.
This commit is contained in:
Guido van Rossum 1999-10-05 22:17:41 +00:00
parent caf2f8e3c7
commit be2033697f
1 changed files with 2 additions and 0 deletions

View File

@ -64,6 +64,8 @@ PySys_GetObject(name)
{ {
PyThreadState *tstate = PyThreadState_Get(); PyThreadState *tstate = PyThreadState_Get();
PyObject *sd = tstate->interp->sysdict; PyObject *sd = tstate->interp->sysdict;
if (sd == NULL)
return NULL;
return PyDict_GetItemString(sd, name); return PyDict_GetItemString(sd, name);
} }