mirror of
https://github.com/python/cpython
synced 2024-09-15 23:06:25 +00:00
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;
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue