Mercurial > cpython-lru_cache-weakref
diff Python/bltinmodule.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 | 2c97e24b16cf |
| children | cbc8b3bd3157 |
line wrap: on
line diff
--- a/Python/bltinmodule.c Thu Nov 15 02:15:53 2007 +0000 +++ b/Python/bltinmodule.c Thu Nov 15 02:26:46 2007 +0000 @@ -1265,17 +1265,17 @@ return NULL; /* Check that stdin/out/err are intact */ - if (fin == NULL) { + if (fin == NULL || fin == Py_None) { PyErr_SetString(PyExc_RuntimeError, "input(): lost sys.stdin"); return NULL; } - if (fout == NULL) { + if (fout == NULL || fout == Py_None) { PyErr_SetString(PyExc_RuntimeError, "input(): lost sys.stdout"); return NULL; } - if (ferr == NULL) { + if (ferr == NULL || ferr == Py_None) { PyErr_SetString(PyExc_RuntimeError, "input(): lost sys.stderr"); return NULL;
