summaryrefslogtreecommitdiffstats
path: root/Objects/fileobject.c
diff options
context:
space:
mode:
authorChristian Heimes <christian@cheimes.de>2007-11-12 17:02:51 (GMT)
committerChristian Heimes <christian@cheimes.de>2007-11-12 17:02:51 (GMT)
commit1607278c2612275d21354619c6ef1e2869178ba7 (patch)
treea70625a458dfe5ac651d8d7ca56f5677f160e2c1 /Objects/fileobject.c
parentaf935e3bc46dde5c32a3d23173e2a8f6ec9a8792 (diff)
downloadcpython-1607278c2612275d21354619c6ef1e2869178ba7.zip
cpython-1607278c2612275d21354619c6ef1e2869178ba7.tar.gz
cpython-1607278c2612275d21354619c6ef1e2869178ba7.tar.bz2
Let's do as Guido says and return None instead of -1
Diffstat (limited to 'Objects/fileobject.c')
-rw-r--r--Objects/fileobject.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/Objects/fileobject.c b/Objects/fileobject.c
index ecf6762..6d6022e 100644
--- a/Objects/fileobject.c
+++ b/Objects/fileobject.c
@@ -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