diff options
Diffstat (limited to 'Lib')
-rwxr-xr-x | Lib/profile.py | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/Lib/profile.py b/Lib/profile.py index d969246..2a96ba8 100755 --- a/Lib/profile.py +++ b/Lib/profile.py @@ -609,11 +609,8 @@ def main(): if (len(args) > 0): sys.argv[:] = args sys.path.insert(0, os.path.dirname(sys.argv[0])) - fp = open(sys.argv[0]) - try: + with open(sys.argv[0], 'rb') as fp: script = fp.read() - finally: - fp.close() run('exec(%r)' % script, options.outfile, options.sort) else: parser.print_usage() |