Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 03897ea

Browse files
author
Moshe Zadka
committed
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)
1 parent 8fcc8e1 commit 03897ea

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

Python/sysmodule.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,11 @@ sys_displayhook(PyObject *self, PyObject *args)
7575
PyObject *modules = interp->modules;
7676
PyObject *builtins = PyDict_GetItemString(modules, "__builtin__");
7777

78+
if (builtins == NULL) {
79+
PyErr_SetString(PyExc_RuntimeError, "lost __builtin__");
80+
return NULL;
81+
}
82+
7883
/* parse arguments */
7984
if (!PyArg_ParseTuple(args, "O:displayhook", &o))
8085
return NULL;

0 commit comments

Comments
 (0)