From be2033697f8b9b44656965888d0533bf6d0a8499 Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Tue, 5 Oct 1999 22:17:41 +0000 Subject: 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. --- Python/sysmodule.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Python/sysmodule.c b/Python/sysmodule.c index 5a066a5..a7a5933 100644 --- a/Python/sysmodule.c +++ b/Python/sysmodule.c @@ -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); } -- cgit v0.12