diff options
author | Christian Heimes <christian@cheimes.de> | 2007-11-15 02:26:46 +0000 |
---|---|---|
committer | Christian Heimes <christian@cheimes.de> | 2007-11-15 02:26:46 +0000 |
commit | 2be03734f89fa0a5de0a2426790be2d16440fb68 (patch) | |
tree | 7d41e63de62d8ebbc41a7d3b46604fe84f65aff6 /Python/bltinmodule.c | |
parent | 70021d716456ffcca9caba707a735e845e18dd6e (diff) | |
download | cpython-git-2be03734f89fa0a5de0a2426790be2d16440fb68.tar.gz |
Added some additional checks for sys.std?? is None, see #1440
Diffstat (limited to 'Python/bltinmodule.c')
-rw-r--r-- | Python/bltinmodule.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c index 755bfc1b38..1b1593e3ce 100644 --- a/Python/bltinmodule.c +++ b/Python/bltinmodule.c @@ -1265,17 +1265,17 @@ builtin_input(PyObject *self, PyObject *args) 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; |