diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2013-10-20 07:58:57 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2013-10-20 07:58:57 -0400 |
commit | 249ad14dfedbe45919b48dbbff445394a64d985c (patch) | |
tree | f88f6356df0087c28e8d18a434e5e9142359352f /igor.py | |
parent | f0459a54bb3e703691359aa3078a8234173ec361 (diff) | |
download | python-coveragepy-249ad14dfedbe45919b48dbbff445394a64d985c.tar.gz |
with statements: no more finally close
Diffstat (limited to 'igor.py')
-rw-r--r-- | igor.py | 5 |
1 files changed, 1 insertions, 4 deletions
@@ -62,11 +62,8 @@ def run_tests_with_coverage(tracer, *nose_args): import nose pth_dir = os.path.dirname(os.path.dirname(nose.__file__)) pth_path = os.path.join(pth_dir, "covcov.pth") - pth_file = open(pth_path, "w") - try: + with open(pth_path, "w") as pth_file: pth_file.write("import coverage; coverage.process_startup()\n") - finally: - pth_file.close() version = "%s%s" % sys.version_info[:2] suffix = "%s_%s_%s" % (version, tracer, socket.gethostname()) |