]> granicus.if.org Git - python/commitdiff
Further fix #7838. CREATE_NEW_CONSOLE was exposed, but none of the
authorBrian Curtin <brian@python.org>
Fri, 29 Apr 2011 20:48:13 +0000 (15:48 -0500)
committerBrian Curtin <brian@python.org>
Fri, 29 Apr 2011 20:48:13 +0000 (15:48 -0500)
constants to be used for STARTUPINFO were exposed due to the change.

Lib/subprocess.py

index e1c9eedabd19f7211c72968ecbd1875f27516cd2..299f73e711a8d3588c7df275d441f6a740202a6d 100644 (file)
@@ -344,7 +344,6 @@ class CalledProcessError(Exception):
 
 
 if mswindows:
-    from _subprocess import CREATE_NEW_CONSOLE
     import threading
     import msvcrt
     import _subprocess
@@ -372,7 +371,15 @@ __all__ = ["Popen", "PIPE", "STDOUT", "call", "check_call", "getstatusoutput",
            "getoutput", "check_output", "CalledProcessError"]
 
 if mswindows:
-    __all__.append("CREATE_NEW_CONSOLE")
+    from _subprocess import (CREATE_NEW_CONSOLE,
+                             STD_INPUT_HANDLE, STD_OUTPUT_HANDLE,
+                             STD_ERROR_HANDLE, SW_HIDE,
+                             STARTF_USESTDHANDLES, STARTF_USESHOWWINDOW)
+                
+    __all__.extend(["CREATE_NEW_CONSOLE",
+                    "STD_INPUT_HANDLE", "STD_OUTPUT_HANDLE",
+                    "STD_ERROR_HANDLE", "SW_HIDE",
+                    "STARTF_USESTDHANDLES", "STARTF_USESHOWWINDOW"])
 try:
     MAXFD = os.sysconf("SC_OPEN_MAX")
 except: