From b94d42b78127beb210a8d9aee0746608412f305f Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sun, 20 Oct 2013 08:05:24 -0400 Subject: try/except/finally is ok now. --- coverage/cmdline.py | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'coverage/cmdline.py') diff --git a/coverage/cmdline.py b/coverage/cmdline.py index f2f0c15..9ff29f3 100644 --- a/coverage/cmdline.py +++ b/coverage/cmdline.py @@ -564,17 +564,16 @@ class CoverageScript(object): self.coverage.start() code_ran = True try: - try: - if options.module: - sys.path[0] = '' - self.run_python_module(args[0], args) - else: - filename = args[0] - sys.path[0] = os.path.abspath(os.path.dirname(filename)) - self.run_python_file(filename, args) - except NoSource: - code_ran = False - raise + if options.module: + sys.path[0] = '' + self.run_python_module(args[0], args) + else: + filename = args[0] + sys.path[0] = os.path.abspath(os.path.dirname(filename)) + self.run_python_file(filename, args) + except NoSource: + code_ran = False + raise finally: self.coverage.stop() if code_ran: -- cgit v1.2.1