[pypy-commit] pypy stdlib-2.7.4: cleanup _subprocess constants, add STILL_ACTIVE

bdkearns noreply at buildbot.pypy.org
Wed Apr 10 20:12:24 CEST 2013


Author: Brian Kearns <bdkearns at gmail.com>
Branch: stdlib-2.7.4
Changeset: r63203:4436949b7f40
Date: 2013-04-10 14:12 -0400
http://bitbucket.org/pypy/pypy/changeset/4436949b7f40/

Log:	cleanup _subprocess constants, add STILL_ACTIVE

diff --git a/lib_pypy/_subprocess.py b/lib_pypy/_subprocess.py
--- a/lib_pypy/_subprocess.py
+++ b/lib_pypy/_subprocess.py
@@ -33,7 +33,7 @@
                              ctypes.POINTER(ctypes.c_int),
                              ctypes.c_int, ctypes.c_int, ctypes.c_int]
 _DuplicateHandle.restype = ctypes.c_int
-    
+
 _WaitForSingleObject = _kernel32.WaitForSingleObject
 _WaitForSingleObject.argtypes = [ctypes.c_int, ctypes.c_uint]
 _WaitForSingleObject.restype = ctypes.c_int
@@ -85,7 +85,7 @@
 
 del ctypes
 
-# Now the _subprocess module implementation 
+# Now the _subprocess module implementation
 
 from ctypes import c_int as _c_int, byref as _byref, WinError as _WinError
 
@@ -123,7 +123,6 @@
 def GetCurrentProcess():
     return _handle(_GetCurrentProcess())
 
-
 def DuplicateHandle(source_process, source, target_process, access, inherit, options=0):
     target = _c_int()
 
@@ -135,8 +134,6 @@
         raise _WinError()
 
     return _handle(target.value)
-DUPLICATE_SAME_ACCESS = 2
-
 
 def CreateProcess(name, command_line, process_attr, thread_attr,
                   inherit, flags, env, start_dir, startup_info):
@@ -168,11 +165,6 @@
         raise _WinError()
 
     return _handle(pi.hProcess), _handle(pi.hThread), pi.dwProcessID, pi.dwThreadID
-STARTF_USESHOWWINDOW = 0x001
-STARTF_USESTDHANDLES = 0x100
-SW_HIDE              = 0
-CREATE_NEW_CONSOLE       = 0x010
-CREATE_NEW_PROCESS_GROUP = 0x200
 
 def WaitForSingleObject(handle, milliseconds):
     res = _WaitForSingleObject(int(handle), milliseconds)
@@ -181,12 +173,10 @@
         raise _WinError()
 
     return res
-INFINITE = 0xffffffff
-WAIT_OBJECT_0 = 0
 
 def GetExitCodeProcess(handle):
     code = _c_int()
-    
+
     res = _GetExitCodeProcess(int(handle), _byref(code))
 
     if not res:
@@ -207,6 +197,16 @@
         return None
     else:
         return res
-STD_INPUT_HANDLE  = -10
+
+STD_INPUT_HANDLE = -10
 STD_OUTPUT_HANDLE = -11
-STD_ERROR_HANDLE  = -12
+STD_ERROR_HANDLE = -12
+DUPLICATE_SAME_ACCESS = 2
+STARTF_USESTDHANDLES = 0x100
+STARTF_USESHOWWINDOW = 0x001
+SW_HIDE = 0
+INFINITE = 0xffffffff
+WAIT_OBJECT_0 = 0
+CREATE_NEW_CONSOLE = 0x010
+CREATE_NEW_PROCESS_GROUP = 0x200
+STILL_ACTIVE = 259


More information about the pypy-commit mailing list