mirror of
https://github.com/python/cpython.git
synced 2025-07-27 13:14:41 +00:00
Bug #1535165: fixed a segfault in input() and raw_input() when
sys.stdin is closed.
This commit is contained in:
parent
534fe18e17
commit
7e3ba2a699
3 changed files with 12 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue