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)
This commit is contained in:
Moshe Zadka 2001-07-23 13:32:43 +00:00
parent 8fcc8e1b4f
commit 03897ea1f7
1 changed files with 5 additions and 0 deletions

View File

@ -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;