Added some additional checks for sys.std?? is None, see #1440

This commit is contained in:
Christian Heimes 2007-11-15 02:26:46 +00:00
parent 70021d7164
commit 2be03734f8
7 changed files with 17 additions and 12 deletions

View file

@ -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;