diff options
Diffstat (limited to 'Modules/posixmodule.c')
-rw-r--r-- | Modules/posixmodule.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index 4731b81..1d1e299 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -6830,9 +6830,7 @@ device_encoding(PyObject *self, PyObject *args) int fd; if (!PyArg_ParseTuple(args, "i:device_encoding", &fd)) return NULL; - if (!_PyVerify_fd(fd)) - return posix_error(); - if (!isatty(fd)) { + if (!_PyVerify_fd(fd) || !isatty(fd)) { Py_INCREF(Py_None); return Py_None; } |