diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2020-01-04 08:51:31 -0500 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2020-01-04 08:51:31 -0500 |
commit | d90c675f62a6ffdb7c4f92edb23b3d2e52a7f6fa (patch) | |
tree | 2ffdf99d3b39fa74a4c45fe5d73226258994b938 /coverage/inorout.py | |
parent | acf063cfff09d26678709ce6894d605f4199db09 (diff) | |
download | python-coveragepy-git-nedbat/bug888.tar.gz |
Ignore namespace packages in the already-imported check. #888nedbat/bug888
Diffstat (limited to 'coverage/inorout.py')
-rw-r--r-- | coverage/inorout.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/coverage/inorout.py b/coverage/inorout.py index d5e8b226..17e11b64 100644 --- a/coverage/inorout.py +++ b/coverage/inorout.py @@ -359,6 +359,10 @@ class InOrOut(object): if filename in warned: continue + if len(getattr(mod, "__path__", ())) > 1: + # A namespace package, which confuses this code, so ignore it. + continue + disp = self.should_trace(filename) if disp.trace: msg = "Already imported a file that will be measured: {}".format(filename) |