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:
parent
caf2f8e3c7
commit
be2033697f
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue