diff options
author | Christian Heimes <christian@cheimes.de> | 2007-11-13 02:19:40 (GMT) |
---|---|---|
committer | Christian Heimes <christian@cheimes.de> | 2007-11-13 02:19:40 (GMT) |
commit | 58cb1b8b0ef200b7f7d4aba82642a63ce7532545 (patch) | |
tree | 629216d60c66aaf168ee0f4903824213fcf4637f /Objects | |
parent | f05149a257560144cbaaea3e96c404803dbf26e4 (diff) | |
download | cpython-58cb1b8b0ef200b7f7d4aba82642a63ce7532545.zip cpython-58cb1b8b0ef200b7f7d4aba82642a63ce7532545.tar.gz cpython-58cb1b8b0ef200b7f7d4aba82642a63ce7532545.tar.bz2 |
Fix for #1415 pythonw.exe fails because std streams a missing
After a long discussion about the problem with Windows GUI apps Guido decided that sys.stdin, stdout and stderr should be None when the C runtime library returns invalid file descriptors for the standard streams.
So far the only known cases are Windows GUI apps and scripts started with pythonw on Windows. The OS restrictions are tight enough to catch the problem on other OSes.
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/fileobject.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Objects/fileobject.c b/Objects/fileobject.c index 6d6022e..5d69911 100644 --- a/Objects/fileobject.c +++ b/Objects/fileobject.c @@ -363,7 +363,7 @@ PyFile_NewStdPrinter(int fd) { PyStdPrinter_Object *self; - if ((fd != fileno(stdout) && fd != fileno(stderr)) || fd < 0) { + if (fd != fileno(stdout) && fd != fileno(stderr)) { /* not enough infrastructure for PyErr_BadInternalCall() */ return NULL; } |