diff options
Diffstat (limited to 'Lib/base64.py')
-rwxr-xr-x | Lib/base64.py | 3 |
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) |