diff Python/sysmodule.c @ 11374:66216f32403d legacy-trunk

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.
author Guido van Rossum <guido@python.org>
date Tue, 05 Oct 1999 22:17:41 +0000
parents d44cb87e500d
children dc65c5f6ad7c
line wrap: on
line diff
--- a/Python/sysmodule.c	Tue Oct 05 22:16:07 1999 +0000
+++ b/Python/sysmodule.c	Tue Oct 05 22:17:41 1999 +0000
@@ -64,6 +64,8 @@
 {
 	PyThreadState *tstate = PyThreadState_Get();
 	PyObject *sd = tstate->interp->sysdict;
+	if (sd == NULL)
+		return NULL;
 	return PyDict_GetItemString(sd, name);
 }