From 249ad14dfedbe45919b48dbbff445394a64d985c Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sun, 20 Oct 2013 07:58:57 -0400 Subject: with statements: no more finally close --- igor.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'igor.py') diff --git a/igor.py b/igor.py index 9f33f15..6c5d56b 100644 --- a/igor.py +++ b/igor.py @@ -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()) -- cgit v1.2.1