diff options
author | Kristján Valur Jónsson <kristjan@ccpgames.com> | 2009-03-24 14:15:49 (GMT) |
---|---|---|
committer | Kristján Valur Jónsson <kristjan@ccpgames.com> | 2009-03-24 14:15:49 (GMT) |
commit | 649170bd66e0084f227b55a6941c41e0c4d79df7 (patch) | |
tree | c0cb59ab6a78cf2876a22326521a08ba44ed9224 /Modules | |
parent | 8915e0e43ac0c8a5c0c96b5a656062cc83188d7f (diff) | |
download | cpython-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.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; } |