Author: Philip Jenvey <[email protected]>
Branch: 
Changeset: r213:235ea28d5947
Date: 2013-05-02 15:58 -0700
http://bitbucket.org/pypy/benchmarks/changeset/235ea28d5947/

Log:    use the with statement

diff --git a/runner.py b/runner.py
--- a/runner.py
+++ b/runner.py
@@ -275,11 +275,9 @@
                 bm_file = open(options.benchmarks_file, 'rt')
             except IOError as e:
                 parser.error('error opening benchmarks file: %s' % e)
-            try:
+            with bm_file:
                 for line in bm_file:
                     benchmarks.append(line.strip())
-            finally:
-                bm_file.close()
         else:
             benchmarks = list(BENCHMARK_SET)
 
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to