]> granicus.if.org Git - python/commitdiff
Re-implemented fix for #1531862 once again, in a way that works with Python 2.2....
authorPeter Astrand <astrand@lysator.liu.se>
Sun, 7 Jan 2007 09:00:11 +0000 (09:00 +0000)
committerPeter Astrand <astrand@lysator.liu.se>
Sun, 7 Jan 2007 09:00:11 +0000 (09:00 +0000)
Lib/subprocess.py

index 981612214a21b4abf023ce0f4a3cce203b8aeca3..abd790dd92a094fd0ab8c249b806244ca3089289 100644 (file)
@@ -1004,8 +1004,12 @@ class Popen(object):
 
                     # Close pipe fds.  Make sure we don't close the same
                     # fd more than once, or standard fds.
-                    for fd in set((p2cread, c2pwrite, errwrite))-set((0,1,2)):
-                        if fd: os.close(fd)
+                    if p2cread and p2cread not in (0,):
+                        os.close(p2cread)
+                    if c2pwrite and c2pwrite not in (p2cread, 1):
+                        os.close(c2pwrite)
+                    if errwrite and errwrite not in (p2cread, c2pwrite, 2):
+                        os.close(errwrite)
 
                     # Close all other fds, if asked for
                     if close_fds: