Kaydet (Commit) c6ecfcd8 authored tarafından Guido van Rossum's avatar Guido van Rossum

Minor correction to the stdprinter object.

üst 826d8973
......@@ -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;
}
......
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