Commit fd1d6f96 authored by Christian Heimes's avatar Christian Heimes

Let's do as Guido says and return None instead of -1

parent 3ce56365
...@@ -387,7 +387,7 @@ stdprinter_write(PyStdPrinter_Object *self, PyObject *args) ...@@ -387,7 +387,7 @@ stdprinter_write(PyStdPrinter_Object *self, PyObject *args)
* I can't raise an exception here. It may lead to an * I can't raise an exception here. It may lead to an
* unlimited recursion in the case stderr is invalid. * unlimited recursion in the case stderr is invalid.
*/ */
return PyLong_FromLong((long)-1); Py_RETURN_NONE;
} }
if (!PyArg_ParseTuple(args, "s", &c)) { if (!PyArg_ParseTuple(args, "s", &c)) {
...@@ -434,8 +434,7 @@ stdprinter_isatty(PyStdPrinter_Object *self) ...@@ -434,8 +434,7 @@ stdprinter_isatty(PyStdPrinter_Object *self)
{ {
long res; long res;
if (self->fd < 0) { if (self->fd < 0) {
Py_INCREF(Py_False); Py_RETURN_FALSE;
return Py_False;
} }
Py_BEGIN_ALLOW_THREADS Py_BEGIN_ALLOW_THREADS
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment