]> granicus.if.org Git - python/commitdiff
Replace dynamic try/except with "if 0", to keep py2exe happy. If you
authorFredrik Lundh <fredrik@pythonware.com>
Wed, 13 Oct 2004 18:19:18 +0000 (18:19 +0000)
committerFredrik Lundh <fredrik@pythonware.com>
Wed, 13 Oct 2004 18:19:18 +0000 (18:19 +0000)
want to use pywin32 instead of _subprocess, you have to edit the file.

Lib/subprocess.py

index 8d72ba04a2a5fea60a6611e62cdaa21321851acb..3a3020d2cee79ad913c133f45cb256966147cdec 100644 (file)
@@ -367,16 +367,7 @@ import traceback
 if mswindows:
     import threading
     import msvcrt
-    try:
-        from _subprocess import *
-        class STARTUPINFO:
-            dwFlags = 0
-            hStdInput = None
-            hStdOutput = None
-            hStdError = None
-        class pywintypes:
-            error = IOError
-    except ImportError:
+    if 0: # <-- change this to use pywin32 instead of the _subprocess driver
         import pywintypes
         from win32api import GetStdHandle, STD_INPUT_HANDLE, \
                              STD_OUTPUT_HANDLE, STD_ERROR_HANDLE
@@ -388,6 +379,15 @@ if mswindows:
                                  GetExitCodeProcess, STARTF_USESTDHANDLES, \
                                  CREATE_NEW_CONSOLE
         from win32event import WaitForSingleObject, INFINITE, WAIT_OBJECT_0
+    else:
+        from _subprocess import *
+        class STARTUPINFO:
+            dwFlags = 0
+            hStdInput = None
+            hStdOutput = None
+            hStdError = None
+        class pywintypes:
+            error = IOError
 else:
     import select
     import errno