diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2013-12-13 22:45:10 -0500 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2013-12-13 22:45:10 -0500 |
commit | 2df9b1c35cbb5c92204fc5923368a3d619a34f6d (patch) | |
tree | d1ede8ffef812ba4e345b08f698f001ebe69cb56 /lab | |
parent | 84221611890880b749dbb650e8d07ac8918dba46 (diff) | |
parent | 7c66441eab3af17539c478a2cb4e19cd93ba0cf4 (diff) | |
download | python-coveragepy-git-2df9b1c35cbb5c92204fc5923368a3d619a34f6d.tar.gz |
Merged 4.0 to default
Diffstat (limited to 'lab')
-rw-r--r-- | lab/parser.py | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/lab/parser.py b/lab/parser.py index ce6902a6..a8e03eec 100644 --- a/lab/parser.py +++ b/lab/parser.py @@ -54,13 +54,11 @@ class ParserMain(object): def one_file(self, options, filename): """Process just one file.""" - if options.dis or options.chunks: - try: - bp = ByteParser(filename=filename) - except CoverageException: - _, err, _ = sys.exc_info() - print("%s" % (err,)) - return + try: + bp = ByteParser(filename=filename) + except CoverageException as err: + print("%s" % (err,)) + return if options.dis: print("Main code:") @@ -88,8 +86,7 @@ class ParserMain(object): exit_counts = cp.exit_counts() - for i, ltext in enumerate(cp.lines): - lineno = i+1 + for lineno, ltext in enumerate(cp.lines, start=1): m0 = m1 = m2 = m3 = a = ' ' if lineno in cp.statement_starts: m0 = '-' |