summaryrefslogtreecommitdiffstats
path: root/Lib/base64.py
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2010-10-14 21:17:39 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2010-10-14 21:17:39 (GMT)
commit3d400b7a58a9f6e338048593ae19ab3cc92a8cd3 (patch)
tree0eac5be6c10a5c55054461d68fe5f62a35713610 /Lib/base64.py
parent51be0f47fa871a7b45c6407183110fde02a79997 (diff)
downloadcpython-3d400b7a58a9f6e338048593ae19ab3cc92a8cd3.zip
cpython-3d400b7a58a9f6e338048593ae19ab3cc92a8cd3.tar.gz
cpython-3d400b7a58a9f6e338048593ae19ab3cc92a8cd3.tar.bz2
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) ........
Diffstat (limited to 'Lib/base64.py')
-rwxr-xr-xLib/base64.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/base64.py b/Lib/base64.py
index b31c410..f93b3a4 100755
--- a/Lib/base64.py
+++ b/Lib/base64.py
@@ -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)