summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2008-02-23 22:14:02 (GMT)
committerGeorg Brandl <georg@python.org>2008-02-23 22:14:02 (GMT)
commitc76ea279659a77ae17b592e89c99b2ecbe3716a5 (patch)
treeee005590e42635d3607ef0c83fda0a128ce96d97
parent8d01bb2b19310a1fa89c166c87301c1d8f9734da (diff)
downloadcpython-c76ea279659a77ae17b592e89c99b2ecbe3716a5.zip
cpython-c76ea279659a77ae17b592e89c99b2ecbe3716a5.tar.gz
cpython-c76ea279659a77ae17b592e89c99b2ecbe3716a5.tar.bz2
Use os.closerange().
-rwxr-xr-xDemo/tkinter/guido/ShellWindow.py6
1 files changed, 1 insertions, 5 deletions
diff --git a/Demo/tkinter/guido/ShellWindow.py b/Demo/tkinter/guido/ShellWindow.py
index 609101b..0b100f1 100755
--- a/Demo/tkinter/guido/ShellWindow.py
+++ b/Demo/tkinter/guido/ShellWindow.py
@@ -121,11 +121,7 @@ def spawn(prog, args):
sys.stderr.write('popen2: bad write dup\n')
if os.dup(c2pwrite) <> 2:
sys.stderr.write('popen2: bad write dup\n')
- for i in range(3, MAXFD):
- try:
- os.close(i)
- except:
- pass
+ os.closerange(3, MAXFD)
try:
os.execvp(prog, args)
finally: