diff options
author | Moshe Zadka <moshez@math.huji.ac.il> | 2001-07-23 13:32:43 +0000 |
---|---|---|
committer | Moshe Zadka <moshez@math.huji.ac.il> | 2001-07-23 13:32:43 +0000 |
commit | 03897ea1f7e956e71c3f570ae836486a91b08191 (patch) | |
tree | 052600955e377ebd54b46829eedb97f317e69c2e /Python/sysmodule.c | |
parent | 8fcc8e1b4fefb071eaba2150f94529e4524337d5 (diff) | |
download | cpython-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.c | 5 |
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; |