Commit 8d01bb2b authored by Georg Brandl's avatar Georg Brandl

Use os.closerange() in popen2.

parent ffada76d
...@@ -82,11 +82,7 @@ class Popen3: ...@@ -82,11 +82,7 @@ class Popen3:
def _run_child(self, cmd): def _run_child(self, cmd):
if isinstance(cmd, basestring): if isinstance(cmd, basestring):
cmd = ['/bin/sh', '-c', cmd] cmd = ['/bin/sh', '-c', cmd]
for i in xrange(3, MAXFD): os.closerange(3, MAXFD)
try:
os.close(i)
except OSError:
pass
try: try:
os.execvp(cmd[0], cmd) os.execvp(cmd[0], cmd)
finally: finally:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment