http://bugs.python.org/issue5552

Return None rather than raise an exception if os.device_error is given an invalid file descriptor.
parent 242ef64d
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment