[Python-checkins] r61019 - python/trunk/Lib/popen2.py
georg.brandl
python-checkins at python.org
Sat Feb 23 23:09:24 CET 2008
Author: georg.brandl
Date: Sat Feb 23 23:09:24 2008
New Revision: 61019
Modified:
python/trunk/Lib/popen2.py
Log:
Use os.closerange() in popen2.
Modified: python/trunk/Lib/popen2.py
==============================================================================
--- python/trunk/Lib/popen2.py (original)
+++ python/trunk/Lib/popen2.py Sat Feb 23 23:09:24 2008
@@ -82,11 +82,7 @@
def _run_child(self, cmd):
if isinstance(cmd, basestring):
cmd = ['/bin/sh', '-c', cmd]
- for i in xrange(3, MAXFD):
- try:
- os.close(i)
- except OSError:
- pass
+ os.closerange(3, MAXFD)
try:
os.execvp(cmd[0], cmd)
finally:
More information about the Python-checkins
mailing list