From c76ea279659a77ae17b592e89c99b2ecbe3716a5 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Sat, 23 Feb 2008 22:14:02 +0000 Subject: Use os.closerange(). --- Demo/tkinter/guido/ShellWindow.py | 6 +----- 1 file changed, 1 insertion(+), 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: -- cgit v0.12