From 03897ea1f7e956e71c3f570ae836486a91b08191 Mon Sep 17 00:00:00 2001 From: Moshe Zadka Date: Mon, 23 Jul 2001 13:32:43 +0000 Subject: [PATCH] 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) --- Python/sysmodule.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Python/sysmodule.c b/Python/sysmodule.c index 0d6d5a0f9ff..4ae207b3c0c 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;