Skip to content

Commit 3044a0b

Browse files
author
georg.brandl
committed
Use os.closerange().
git-svn-id: http://svn.python.org/projects/python/trunk@61020 6015fed2-1504-0410-9fe1-9d1591cc4771
1 parent ad36f55 commit 3044a0b

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

Demo/tkinter/guido/ShellWindow.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -121,11 +121,7 @@ def spawn(prog, args):
121121
sys.stderr.write('popen2: bad write dup\n')
122122
if os.dup(c2pwrite) <> 2:
123123
sys.stderr.write('popen2: bad write dup\n')
124-
for i in range(3, MAXFD):
125-
try:
126-
os.close(i)
127-
except:
128-
pass
124+
os.closerange(3, MAXFD)
129125
try:
130126
os.execvp(prog, args)
131127
finally:

0 commit comments

Comments
 (0)