summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorMartin Panter <vadmium+py@gmail.com>2015-10-10 02:09:41 (GMT)
committerMartin Panter <vadmium+py@gmail.com>2015-10-10 02:09:41 (GMT)
commit5344da5c0d9ff35976b133c665329584a82b4098 (patch)
treebd646167e65e64a6734fe40c8bb0c48e02ccc666 /Python
parent748cf9b66e4343a248f19fd6322c6329b6c7013d (diff)
parente02f8fc44d59886c00d5444ca557a38a9bed2eac (diff)
downloadcpython-5344da5c0d9ff35976b133c665329584a82b4098.zip
cpython-5344da5c0d9ff35976b133c665329584a82b4098.tar.gz
cpython-5344da5c0d9ff35976b133c665329584a82b4098.tar.bz2
Issue #24402: Merge input() fix from 3.5
Diffstat (limited to 'Python')
-rw-r--r--Python/bltinmodule.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c
index 3c8f1e9..3b70718 100644
--- a/Python/bltinmodule.c
+++ b/Python/bltinmodule.c
@@ -1854,8 +1854,10 @@ builtin_input_impl(PyModuleDef *module, PyObject *prompt)
}
if (tty) {
tmp = _PyObject_CallMethodId(fout, &PyId_fileno, "");
- if (tmp == NULL)
+ if (tmp == NULL) {
PyErr_Clear();
+ tty = 0;
+ }
else {
fd = PyLong_AsLong(tmp);
Py_DECREF(tmp);