summaryrefslogtreecommitdiff
path: root/coverage/control.py
diff options
context:
space:
mode:
authorloic@dachary.org <loic@dachary.org>2017-01-10 22:21:13 +0100
committerloic@dachary.org <loic@dachary.org>2017-01-10 22:21:13 +0100
commitffc050e243b4c329f582372dd49c55aa225197b9 (patch)
treec9f02070a1d49402b25680c30f2148fcd2cc7616 /coverage/control.py
parent6da69c9cfcf8874cc423177a9376e90e27218d1d (diff)
downloadpython-coveragepy-git-ffc050e243b4c329f582372dd49c55aa225197b9.tar.gz
use the new source_for_file helper where it makes sense
--HG-- branch : issue-426
Diffstat (limited to 'coverage/control.py')
-rw-r--r--coverage/control.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/coverage/control.py b/coverage/control.py
index 376d3f54..79694320 100644
--- a/coverage/control.py
+++ b/coverage/control.py
@@ -810,8 +810,8 @@ class Coverage(object):
not hasattr(sys.modules[pkg], '__file__') or
not os.path.exists(sys.modules[pkg].__file__)):
continue
- pkg_file = sys.modules[pkg].__file__
- if not pkg_file.endswith(('__init__.py', '__init__.pyc', '__init__.pyo')):
+ pkg_file = source_for_file(sys.modules[pkg].__file__)
+ if not pkg_file.endswith('__init__.py'):
continue
src_directories.append(self._canonical_dir(sys.modules[pkg]))