summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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: