]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Let's do as Guido says and return None instead of -1
authorChristian Heimes <christian@cheimes.de>
Mon, 12 Nov 2007 17:02:51 +0000 (17:02 +0000)
committerChristian Heimes <christian@cheimes.de>
Mon, 12 Nov 2007 17:02:51 +0000 (17:02 +0000)
Objects/fileobject.c

index ecf67621f32f160d6496475a23cd00830b32e5a4..6d6022eedfdd0b87f00e41371bfb70fe0cb09bae 100644 (file)
@@ -387,7 +387,7 @@ stdprinter_write(PyStdPrinter_Object *self, PyObject *args)
                 * 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 @@ stdprinter_isatty(PyStdPrinter_Object *self)
 {
        long res;
        if (self->fd < 0) {
-               Py_INCREF(Py_False);
-               return Py_False;
+               Py_RETURN_FALSE;
        }
 
        Py_BEGIN_ALLOW_THREADS