mirror of
https://github.com/python/cpython.git
synced 2025-12-04 16:43:27 +00:00
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.
This commit is contained in:
parent
22dcf66f84
commit
3e73a011d9
1 changed files with 10 additions and 10 deletions
|
|
@ -367,16 +367,7 @@ import traceback
|
||||||
if mswindows:
|
if mswindows:
|
||||||
import threading
|
import threading
|
||||||
import msvcrt
|
import msvcrt
|
||||||
try:
|
if 0: # <-- change this to use pywin32 instead of the _subprocess driver
|
||||||
from _subprocess import *
|
|
||||||
class STARTUPINFO:
|
|
||||||
dwFlags = 0
|
|
||||||
hStdInput = None
|
|
||||||
hStdOutput = None
|
|
||||||
hStdError = None
|
|
||||||
class pywintypes:
|
|
||||||
error = IOError
|
|
||||||
except ImportError:
|
|
||||||
import pywintypes
|
import pywintypes
|
||||||
from win32api import GetStdHandle, STD_INPUT_HANDLE, \
|
from win32api import GetStdHandle, STD_INPUT_HANDLE, \
|
||||||
STD_OUTPUT_HANDLE, STD_ERROR_HANDLE
|
STD_OUTPUT_HANDLE, STD_ERROR_HANDLE
|
||||||
|
|
@ -388,6 +379,15 @@ if mswindows:
|
||||||
GetExitCodeProcess, STARTF_USESTDHANDLES, \
|
GetExitCodeProcess, STARTF_USESTDHANDLES, \
|
||||||
CREATE_NEW_CONSOLE
|
CREATE_NEW_CONSOLE
|
||||||
from win32event import WaitForSingleObject, INFINITE, WAIT_OBJECT_0
|
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:
|
else:
|
||||||
import select
|
import select
|
||||||
import errno
|
import errno
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue