Mercurial > cpython-lru_cache-weakref
comparison Python/sysmodule.c @ 21029:ee24bd0cad29 2.1
backport of 2.90:
Patch number #422106 by Greg Ball, to fix segmentation
fault in sys.displayhook.
| author | Anthony Baxter <anthonybaxter@gmail.com> |
|---|---|
| date | Wed, 21 Nov 2001 03:51:20 +0000 |
| parents | beb9d2b02846 |
| children |
comparison
equal
deleted
inserted
replaced
| 21019:62c63ba90df2 | 21029:ee24bd0cad29 |
|---|---|
| 72 { | 72 { |
| 73 PyObject *o, *outf; | 73 PyObject *o, *outf; |
| 74 PyInterpreterState *interp = PyThreadState_Get()->interp; | 74 PyInterpreterState *interp = PyThreadState_Get()->interp; |
| 75 PyObject *modules = interp->modules; | 75 PyObject *modules = interp->modules; |
| 76 PyObject *builtins = PyDict_GetItemString(modules, "__builtin__"); | 76 PyObject *builtins = PyDict_GetItemString(modules, "__builtin__"); |
| 77 | |
| 78 if (builtins == NULL) { | |
| 79 PyErr_SetString(PyExc_RuntimeError, "lost __builtin__"); | |
| 80 return NULL; | |
| 81 } | |
| 77 | 82 |
| 78 /* parse arguments */ | 83 /* parse arguments */ |
| 79 if (!PyArg_ParseTuple(args, "O:displayhook", &o)) | 84 if (!PyArg_ParseTuple(args, "O:displayhook", &o)) |
| 80 return NULL; | 85 return NULL; |
| 81 | 86 |
