mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
Merged revisions 85497 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r85497 | antoine.pitrou | 2010-10-14 23:15:17 +0200 (jeu., 14 oct. 2010) | 3 lines Explicitly close some files (from issue #10093) ........
This commit is contained in:
parent
51be0f47fa
commit
3d400b7a58
3 changed files with 11 additions and 5 deletions
|
@ -383,7 +383,8 @@ def main():
|
|||
if o == '-u': func = decode
|
||||
if o == '-t': test(); return
|
||||
if args and args[0] != '-':
|
||||
func(open(args[0], 'rb'), sys.stdout.buffer)
|
||||
with open(args[0], 'rb') as f:
|
||||
func(f, sys.stdout.buffer)
|
||||
else:
|
||||
func(sys.stdin.buffer, sys.stdout.buffer)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue