Bug #1535165: fixed a segfault in input() and raw_input() when

sys.stdin is closed.
This commit is contained in:
Georg Brandl 2006-08-06 08:23:54 +00:00
parent 534fe18e17
commit 7e3ba2a699
3 changed files with 12 additions and 1 deletions

View file

@ -1725,7 +1725,7 @@ builtin_raw_input(PyObject *self, PyObject *args)
if (PyFile_WriteString(" ", fout) != 0)
return NULL;
}
if (PyFile_Check(fin) && PyFile_Check(fout)
if (PyFile_AsFile(fin) && PyFile_AsFile(fout)
&& isatty(fileno(PyFile_AsFile(fin)))
&& isatty(fileno(PyFile_AsFile(fout)))) {
PyObject *po;