summaryrefslogtreecommitdiff
path: root/Lib/subprocess.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/subprocess.py')
-rw-r--r--Lib/subprocess.py9
1 files changed, 2 insertions, 7 deletions
diff --git a/Lib/subprocess.py b/Lib/subprocess.py
index ca9489e67d..29c25bcd3a 100644
--- a/Lib/subprocess.py
+++ b/Lib/subprocess.py
@@ -965,13 +965,8 @@ class Popen(object):
def _close_fds(self, but):
- for i in xrange(3, MAXFD):
- if i == but:
- continue
- try:
- os.close(i)
- except:
- pass
+ os.closerange(3, but)
+ os.closerange(but + 1, MAXFD)
def _execute_child(self, args, executable, preexec_fn, close_fds,