summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFredrik Lundh <fredrik@pythonware.com>2004-10-13 18:19:18 (GMT)
committerFredrik Lundh <fredrik@pythonware.com>2004-10-13 18:19:18 (GMT)
commit3e73a011d9c04b3460c05c2d026d2d8964b79cf3 (patch)
tree36289c09096c48c61162a4934c28f7f74eaec3de
parent22dcf66f849c50c8bcb08537c02e8242ae6a0f4a (diff)
downloadcpython-3e73a011d9c04b3460c05c2d026d2d8964b79cf3.zip
cpython-3e73a011d9c04b3460c05c2d026d2d8964b79cf3.tar.gz
cpython-3e73a011d9c04b3460c05c2d026d2d8964b79cf3.tar.bz2
Replace dynamic try/except with "if 0", to keep py2exe happy. If you
want to use pywin32 instead of _subprocess, you have to edit the file.
-rw-r--r--Lib/subprocess.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/Lib/subprocess.py b/Lib/subprocess.py
index 8d72ba0..3a3020d 100644
--- a/Lib/subprocess.py
+++ b/Lib/subprocess.py
@@ -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