diff Python/sysmodule.c @ 43855:ee081609cee8

Added some additional checks for sys.std?? is None, see #1440
author Christian Heimes <christian@cheimes.de>
date Thu, 15 Nov 2007 02:26:46 +0000
parents 0377ba9bc359
children 110ff614ec28
line wrap: on
line diff
--- a/Python/sysmodule.c	Thu Nov 15 02:15:53 2007 +0000
+++ b/Python/sysmodule.c	Thu Nov 15 02:26:46 2007 +0000
@@ -89,7 +89,7 @@
 	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;
 	}