Minor correction to the stdprinter object.
This commit is contained in:
parent
826d8973ac
commit
c6ecfcd876
@ -352,14 +352,16 @@ PyFile_NewStdPrinter(int fd)
|
|||||||
{
|
{
|
||||||
PyStdPrinter_Object *self;
|
PyStdPrinter_Object *self;
|
||||||
|
|
||||||
if (fd != 1 && fd != 2) {
|
if (fd != fileno(stdout) && fd != fileno(stderr)) {
|
||||||
PyErr_BadInternalCall();
|
PyErr_BadInternalCall();
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
self = PyObject_New(PyStdPrinter_Object,
|
self = PyObject_New(PyStdPrinter_Object,
|
||||||
&PyStdPrinter_Type);
|
&PyStdPrinter_Type);
|
||||||
self->fd = fd;
|
if (self != NULL) {
|
||||||
|
self->fd = fd;
|
||||||
|
}
|
||||||
return (PyObject*)self;
|
return (PyObject*)self;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user