summaryrefslogtreecommitdiffstats
path: root/Python/sysmodule.c
diff options
context:
space:
mode:
authorChristian Heimes <christian@cheimes.de>2007-11-15 02:26:46 (GMT)
committerChristian Heimes <christian@cheimes.de>2007-11-15 02:26:46 (GMT)
commit2be03734f89fa0a5de0a2426790be2d16440fb68 (patch)
tree7d41e63de62d8ebbc41a7d3b46604fe84f65aff6 /Python/sysmodule.c
parent70021d716456ffcca9caba707a735e845e18dd6e (diff)
downloadcpython-2be03734f89fa0a5de0a2426790be2d16440fb68.zip
cpython-2be03734f89fa0a5de0a2426790be2d16440fb68.tar.gz
cpython-2be03734f89fa0a5de0a2426790be2d16440fb68.tar.bz2
Added some additional checks for sys.std?? is None, see #1440
Diffstat (limited to 'Python/sysmodule.c')
-rw-r--r--Python/sysmodule.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Python/sysmodule.c b/Python/sysmodule.c
index b77d184..2fcba54 100644
--- a/Python/sysmodule.c
+++ b/Python/sysmodule.c
@@ -89,7 +89,7 @@ sys_displayhook(PyObject *self, PyObject *o)
if (PyObject_SetAttrString(builtins, "_", Py_None) != 0)
return NULL;
outf = PySys_GetObject("stdout");
- if (outf == NULL) {
+ if (outf == NULL || outf == Py_None) {
PyErr_SetString(PyExc_RuntimeError, "lost sys.stdout");
return NULL;
}