summaryrefslogtreecommitdiff
path: root/Python/sysmodule.c
diff options
context:
space:
mode:
authorMoshe Zadka <moshez@math.huji.ac.il>2001-07-23 13:32:43 +0000
committerMoshe Zadka <moshez@math.huji.ac.il>2001-07-23 13:32:43 +0000
commit03897ea1f7e956e71c3f570ae836486a91b08191 (patch)
tree052600955e377ebd54b46829eedb97f317e69c2e /Python/sysmodule.c
parent8fcc8e1b4fefb071eaba2150f94529e4524337d5 (diff)
downloadcpython-git-03897ea1f7e956e71c3f570ae836486a91b08191.tar.gz
Patch number #422106 by Greg Ball, to fix segmentation
fault in sys.displayhook. Please check this in on the 2.2a1 branch (or whatever is necessary to get it working next release)
Diffstat (limited to 'Python/sysmodule.c')
-rw-r--r--Python/sysmodule.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/Python/sysmodule.c b/Python/sysmodule.c
index 0d6d5a0f9f..4ae207b3c0 100644
--- a/Python/sysmodule.c
+++ b/Python/sysmodule.c
@@ -75,6 +75,11 @@ sys_displayhook(PyObject *self, PyObject *args)
PyObject *modules = interp->modules;
PyObject *builtins = PyDict_GetItemString(modules, "__builtin__");
+ if (builtins == NULL) {
+ PyErr_SetString(PyExc_RuntimeError, "lost __builtin__");
+ return NULL;
+ }
+
/* parse arguments */
if (!PyArg_ParseTuple(args, "O:displayhook", &o))
return NULL;