diff options
author | loic@dachary.org <loic@dachary.org> | 2017-01-10 22:44:51 +0100 |
---|---|---|
committer | loic@dachary.org <loic@dachary.org> | 2017-01-10 22:44:51 +0100 |
commit | df97ecb1b06192dced1aeeaf3526999c2deafb96 (patch) | |
tree | 308e4cc6b92b6fd46a06c13396f48232a0d11cf7 /coverage/control.py | |
parent | eb2d5d51543fe8be292dd3643e50913901d4a736 (diff) | |
download | python-coveragepy-git-df97ecb1b06192dced1aeeaf3526999c2deafb96.tar.gz |
comment explaining the rationale of --source pkg
--HG--
branch : issue-426
Diffstat (limited to 'coverage/control.py')
-rw-r--r-- | coverage/control.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/coverage/control.py b/coverage/control.py index 79694320..243fe587 100644 --- a/coverage/control.py +++ b/coverage/control.py @@ -811,6 +811,12 @@ class Coverage(object): not os.path.exists(sys.modules[pkg].__file__)): continue pkg_file = source_for_file(sys.modules[pkg].__file__) + # + # Do not explore the souce tree of a module that is + # not a directory tree. For instance if + # sys.modules['args'].__file__ == /lib/python2.7/site-packages/args.pyc + # we do not want to explore all of /lib/python2.7/site-packages + # if not pkg_file.endswith('__init__.py'): continue src_directories.append(self._canonical_dir(sys.modules[pkg])) |