From 2be03734f89fa0a5de0a2426790be2d16440fb68 Mon Sep 17 00:00:00 2001 From: Christian Heimes Date: Thu, 15 Nov 2007 02:26:46 +0000 Subject: Added some additional checks for sys.std?? is None, see #1440 --- Python/sysmodule.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Python/sysmodule.c') diff --git a/Python/sysmodule.c b/Python/sysmodule.c index b77d18417ac..2fcba5471c2 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; } -- cgit v1.2.3