diff options
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 0d6d5a0..4ae207b 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; |