diff Lib/subprocess.py @ 38590:913e5e84fade 2.4

Bug #1500293: fix memory leaks in _subprocess module. (backport from rev. 46651)
author Georg Brandl <georg@python.org>
date Sun, 04 Jun 2006 22:15:45 +0000
parents 3028e30aa835
children d84224320f82
line wrap: on
line diff
--- a/Lib/subprocess.py	Sat Jun 03 20:34:33 2006 +0000
+++ b/Lib/subprocess.py	Sun Jun 04 22:15:45 2006 +0000
@@ -369,6 +369,7 @@
             hStdInput = None
             hStdOutput = None
             hStdError = None
+            wShowWindow = 0
         class pywintypes:
             error = IOError
 else:
@@ -662,18 +663,17 @@
                 args = list2cmdline(args)
 
             # Process startup details
-            default_startupinfo = STARTUPINFO()
             if startupinfo == None:
-                startupinfo = default_startupinfo
-            if not None in (p2cread, c2pwrite, errwrite):
+                startupinfo = STARTUPINFO()
+            if None not in (p2cread, c2pwrite, errwrite):
                 startupinfo.dwFlags |= STARTF_USESTDHANDLES
                 startupinfo.hStdInput = p2cread
                 startupinfo.hStdOutput = c2pwrite
                 startupinfo.hStdError = errwrite
 
             if shell:
-                default_startupinfo.dwFlags |= STARTF_USESHOWWINDOW
-                default_startupinfo.wShowWindow = SW_HIDE
+                startupinfo.dwFlags |= STARTF_USESHOWWINDOW
+                startupinfo.wShowWindow = SW_HIDE
                 comspec = os.environ.get("COMSPEC", "cmd.exe")
                 args = comspec + " /c " + args
                 if (GetVersion() >= 0x80000000L or