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 | ff0f1ae98dad66594cd34b5aa7c24e909554bad3 (patch) | |
tree | fdcac4f02baa46101c4ab0cfe6904823b3b600cc /lab | |
parent | 0dd9c8fb84dab988f1e34421bb91d53d45da807b (diff) | |
download | python-coveragepy-ff0f1ae98dad66594cd34b5aa7c24e909554bad3.tar.gz |
Unify and clarify reading Python source. Probably broke .pyw files
Diffstat (limited to 'lab')
-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 932480d..1783468 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 |