mirror of https://github.com/python/cpython
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:
parent
8fcc8e1b4f
commit
03897ea1f7
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue