Author: guido.van.rossum
Date: Tue Oct 30 19:36:44 2007
New Revision: 58720

Modified:
   python/branches/py3k/Objects/fileobject.c
Log:
Minor correction to the stdprinter object.


Modified: python/branches/py3k/Objects/fileobject.c
==============================================================================
--- python/branches/py3k/Objects/fileobject.c   (original)
+++ python/branches/py3k/Objects/fileobject.c   Tue Oct 30 19:36:44 2007
@@ -352,14 +352,16 @@
 {
        PyStdPrinter_Object *self;
 
-       if (fd != 1 && fd != 2) {
+       if (fd != fileno(stdout) && fd != fileno(stderr)) {
                PyErr_BadInternalCall();
                return NULL;
        }
 
        self = PyObject_New(PyStdPrinter_Object,
                            &PyStdPrinter_Type);
-       self->fd = fd;
+        if (self != NULL) {
+               self->fd = fd;
+       }
        return (PyObject*)self;
 }
 
_______________________________________________
Python-3000-checkins mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-3000-checkins

Reply via email to