summaryrefslogtreecommitdiffstats
path: root/Lib/base64.py
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2010-10-14 21:22:52 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2010-10-14 21:22:52 (GMT)
commitf7c24450bebabbe9870b1b306ca2d9257ec280c6 (patch)
tree842a1a1b551bf7a7b6c84bcf2dbaa8a78ce074af /Lib/base64.py
parentb67660fcceabd6cac7d4dea593db34bffa52dc98 (diff)
downloadcpython-f7c24450bebabbe9870b1b306ca2d9257ec280c6.zip
cpython-f7c24450bebabbe9870b1b306ca2d9257ec280c6.tar.gz
cpython-f7c24450bebabbe9870b1b306ca2d9257ec280c6.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 41a5e14..85204dd 100755
--- a/Lib/base64.py
+++ b/Lib/base64.py
@@ -343,7 +343,8 @@ def test():
if o == '-u': func = decode
if o == '-t': test1(); return
if args and args[0] != '-':
- func(open(args[0], 'rb'), sys.stdout)
+ with open(args[0], 'rb') as f:
+ func(f, sys.stdout)
else:
func(sys.stdin, sys.stdout)