diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2014-12-26 10:48:29 -0500 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2014-12-26 10:48:29 -0500 |
commit | 135467172407a7f40907cc752f282bf0e3cce306 (patch) | |
tree | 48cc1c881f8cda7c2a5180e19b61e257e7c90d74 /lab/parser.py | |
parent | a6e77b38f2341ae2ff4713119fdcad0bb3515e11 (diff) | |
download | python-coveragepy-git-135467172407a7f40907cc752f282bf0e3cce306.tar.gz |
Unify and clarify reading Python source. Probably broke .pyw files
Diffstat (limited to 'lab/parser.py')
-rw-r--r-- | lab/parser.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lab/parser.py b/lab/parser.py index 932480df..1783468b 100644 --- a/lab/parser.py +++ b/lab/parser.py @@ -9,6 +9,7 @@ from optparse import OptionParser import disgen from coverage.misc import CoverageException +from coverage.files import get_python_source from coverage.parser import ByteParser, PythonParser opcode_counts = collections.Counter() @@ -70,7 +71,8 @@ class ParserMain(object): """Process just one file.""" try: - bp = ByteParser(filename=filename) + text = get_python_source(filename) + bp = ByteParser(text, filename=filename) except Exception as err: print("%s" % (err,)) return |