diff options
author | Georg Brandl <georg@python.org> | 2008-02-23 22:14:02 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2008-02-23 22:14:02 (GMT) |
commit | c76ea279659a77ae17b592e89c99b2ecbe3716a5 (patch) | |
tree | ee005590e42635d3607ef0c83fda0a128ce96d97 /Demo/tkinter | |
parent | 8d01bb2b19310a1fa89c166c87301c1d8f9734da (diff) | |
download | cpython-c76ea279659a77ae17b592e89c99b2ecbe3716a5.zip cpython-c76ea279659a77ae17b592e89c99b2ecbe3716a5.tar.gz cpython-c76ea279659a77ae17b592e89c99b2ecbe3716a5.tar.bz2 |
Use os.closerange().
Diffstat (limited to 'Demo/tkinter')
-rwxr-xr-x | Demo/tkinter/guido/ShellWindow.py | 6 |
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: |