[Python-3000-checkins] r58949 - python/branches/py3k/Objects/fileobject.c

christian.heimes python-3000-checkins at python.org
Mon Nov 12 18:02:52 CET 2007


Author: christian.heimes
Date: Mon Nov 12 18:02:51 2007
New Revision: 58949

Modified:
   python/branches/py3k/Objects/fileobject.c
Log:
Let's do as Guido says and return None instead of -1

Modified: python/branches/py3k/Objects/fileobject.c
==============================================================================
--- python/branches/py3k/Objects/fileobject.c	(original)
+++ python/branches/py3k/Objects/fileobject.c	Mon Nov 12 18:02:51 2007
@@ -387,7 +387,7 @@
 		 * I can't raise an exception here. It may lead to an
 		 * unlimited recursion in the case stderr is invalid.
 		 */
-		return PyLong_FromLong((long)-1);
+		Py_RETURN_NONE;
 	}
 
 	if (!PyArg_ParseTuple(args, "s", &c)) {
@@ -434,8 +434,7 @@
 {
 	long res;
 	if (self->fd < 0) {
-		Py_INCREF(Py_False);
-		return Py_False;
+		Py_RETURN_FALSE;
 	}
 
 	Py_BEGIN_ALLOW_THREADS


More information about the Python-3000-checkins mailing list