Re-implemented fix for #1531862 once again, in a way that works with Python 2.2. Fixes bug #1603424.
This commit is contained in:
parent
e8330fa2aa
commit
ec05a2d580
|
@ -1004,8 +1004,12 @@ class Popen(object):
|
||||||
|
|
||||||
# Close pipe fds. Make sure we don't close the same
|
# Close pipe fds. Make sure we don't close the same
|
||||||
# fd more than once, or standard fds.
|
# fd more than once, or standard fds.
|
||||||
for fd in set((p2cread, c2pwrite, errwrite))-set((0,1,2)):
|
if p2cread and p2cread not in (0,):
|
||||||
if fd: os.close(fd)
|
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
|
# Close all other fds, if asked for
|
||||||
if close_fds:
|
if close_fds:
|
||||||
|
|
Loading…
Reference in New Issue