summaryrefslogtreecommitdiffstats
path: root/PC/WinMain.c
diff options
context:
space:
mode:
authorFredrik Lundh <fredrik@pythonware.com>2000-07-08 20:49:58 (GMT)
committerFredrik Lundh <fredrik@pythonware.com>2000-07-08 20:49:58 (GMT)
commitc0348ac6703a142a6b380ec3cbebed75a09af675 (patch)
tree116f68a468758b2fbd6ebe574d5da75ed1dae78a /PC/WinMain.c
parent89610a4d502d88d9a5877cfe8438c06bc41e6678 (diff)
downloadcpython-c0348ac6703a142a6b380ec3cbebed75a09af675.zip
cpython-c0348ac6703a142a6b380ec3cbebed75a09af675.tar.gz
cpython-c0348ac6703a142a6b380ec3cbebed75a09af675.tar.bz2
- removed barry's workaround, to make room for
bill's more complete solution.
Diffstat (limited to 'PC/WinMain.c')
-rw-r--r--PC/WinMain.c30
1 files changed, 0 insertions, 30 deletions
diff --git a/PC/WinMain.c b/PC/WinMain.c
index 0081af4..c3d0f2f 100644
--- a/PC/WinMain.c
+++ b/PC/WinMain.c
@@ -2,8 +2,6 @@
#define WINDOWS_LEAN_AND_MEAN
#include <windows.h>
-#include <fcntl.h>
-#include <sys/stat.h>
#include "Python.h"
@@ -16,33 +14,5 @@ int WINAPI WinMain(
int nCmdShow /* show state of window */
)
{
- int null_file;
-
- /*
- * make sure that the C RTL has valid file descriptors for
- * stdin, stdout, stderr. Use the NUL device if necessary.
- * This allows popen to work under pythonw.
- *
- * When pythonw.exe starts the C RTL function _ioinit is called
- * first. WinMain is called later hence the need to check for
- * invalid handles.
- *
- * Note: FILE stdin, stdout, stderr do not use the file descriptors
- * setup here. They are already initialised before WinMain was called.
- */
-
- null_file = open("NUL", _O_RDWR);
-
- if (_get_osfhandle(0) == -1)
- dup2(null_file, 0);
-
- if (_get_osfhandle(1) == -1)
- dup2(null_file, 1);
-
- if (_get_osfhandle(2) == -1)
- dup2(null_file, 2);
-
- close(null_file);
-
return Py_Main(__argc, __argv);
}