summaryrefslogtreecommitdiff
path: root/Python/bltinmodule.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/bltinmodule.c')
-rw-r--r--Python/bltinmodule.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c
index 2f22209e9d..7f7d051c71 100644
--- a/Python/bltinmodule.c
+++ b/Python/bltinmodule.c
@@ -1853,8 +1853,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);