mirror of
https://github.com/python/cpython.git
synced 2025-10-21 06:02:21 +00:00
Added some additional checks for sys.std?? is None, see #1440
This commit is contained in:
parent
70021d7164
commit
2be03734f8
7 changed files with 17 additions and 12 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue