[Python-checkins] r70581 - python/branches/py3k/Modules/posixmodule.c

kristjan.jonsson python-checkins at python.org
Tue Mar 24 15:15:49 CET 2009


Author: kristjan.jonsson
Date: Tue Mar 24 15:15:49 2009
New Revision: 70581

Log:
http://bugs.python.org/issue5552
Return None rather than raise an exception if os.device_error is given an invalid file descriptor.

Modified:
   python/branches/py3k/Modules/posixmodule.c

Modified: python/branches/py3k/Modules/posixmodule.c
==============================================================================
--- python/branches/py3k/Modules/posixmodule.c	(original)
+++ python/branches/py3k/Modules/posixmodule.c	Tue Mar 24 15:15:49 2009
@@ -6830,9 +6830,7 @@
 	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;
 	}


More information about the Python-checkins mailing list