From 8c3cddefe07e25d96d9e9c4d7ea24b345d88eeec 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. --HG-- branch : 4.0 --- 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 f2f0c152..9ff29f3a 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