mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
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
1 changed files with 2 additions and 0 deletions
|
@ -64,6 +64,8 @@ PySys_GetObject(name)
|
|||
{
|
||||
PyThreadState *tstate = PyThreadState_Get();
|
||||
PyObject *sd = tstate->interp->sysdict;
|
||||
if (sd == NULL)
|
||||
return NULL;
|
||||
return PyDict_GetItemString(sd, name);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue