diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2009-04-15 13:22:51 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2009-04-15 13:22:51 -0400 |
commit | 341ae4222fbba91987dac1ff0d2debe5c0c8ef99 (patch) | |
tree | c2492004e594b7a61c3750fc0d365d38f014dbc5 /coverage/codeunit.py | |
parent | c2284d65bdb56cd1eb56c3e53228892824189732 (diff) | |
download | python-coveragepy-git-341ae4222fbba91987dac1ff0d2debe5c0c8ef99.tar.gz |
If a module was loaded from a .pyc, report its file as .py
Diffstat (limited to 'coverage/codeunit.py')
-rw-r--r-- | coverage/codeunit.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/coverage/codeunit.py b/coverage/codeunit.py index 221d677a..96ed43bb 100644 --- a/coverage/codeunit.py +++ b/coverage/codeunit.py @@ -57,6 +57,9 @@ class CodeUnit: f = morf.__file__ else: f = morf + # .pyc files should always refer to a .py instead. + if f.endswith('.pyc'): + f = f[:-1] self.filename = file_locator.canonical_filename(f) if hasattr(morf, '__name__'): |