From 6b6a4488adc12d390c5e0c8f13829dd9bf125309 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 --HG-- branch : 4.0 --- igor.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'igor.py') diff --git a/igor.py b/igor.py index 9f33f153..6c5d56bf 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