summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorKristján Valur Jónsson <kristjan@ccpgames.com>2009-03-24 14:15:49 (GMT)
committerKristján Valur Jónsson <kristjan@ccpgames.com>2009-03-24 14:15:49 (GMT)
commit649170bd66e0084f227b55a6941c41e0c4d79df7 (patch)
treec0cb59ab6a78cf2876a22326521a08ba44ed9224 /Modules
parent8915e0e43ac0c8a5c0c96b5a656062cc83188d7f (diff)
downloadcpython-649170bd66e0084f227b55a6941c41e0c4d79df7.zip
cpython-649170bd66e0084f227b55a6941c41e0c4d79df7.tar.gz
cpython-649170bd66e0084f227b55a6941c41e0c4d79df7.tar.bz2
http://bugs.python.org/issue5552
Return None rather than raise an exception if os.device_error is given an invalid file descriptor.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/posixmodule.c4
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;
}