diff options
| author | Peter Astrand <astrand@lysator.liu.se> | 2007-01-07 08:53:46 (GMT) | 
|---|---|---|
| committer | Peter Astrand <astrand@lysator.liu.se> | 2007-01-07 08:53:46 (GMT) | 
| commit | ec05a2d5803db2e9d38e1126b8b88062b9e11ce8 (patch) | |
| tree | 268b23b3c84fb18bccd4d5a2f29b2f2170080b01 /Lib/subprocess.py | |
| parent | e8330fa2aaef31ad3216cbbb35101e3b4ac62d2a (diff) | |
| download | cpython-ec05a2d5803db2e9d38e1126b8b88062b9e11ce8.zip cpython-ec05a2d5803db2e9d38e1126b8b88062b9e11ce8.tar.gz cpython-ec05a2d5803db2e9d38e1126b8b88062b9e11ce8.tar.bz2  | |
Re-implemented fix for #1531862 once again, in a way that works with Python 2.2. Fixes bug #1603424.
Diffstat (limited to 'Lib/subprocess.py')
| -rw-r--r-- | Lib/subprocess.py | 8 | 
1 files changed, 6 insertions, 2 deletions
diff --git a/Lib/subprocess.py b/Lib/subprocess.py index 9816122..abd790d 100644 --- a/Lib/subprocess.py +++ b/Lib/subprocess.py @@ -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:  | 
