diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2021-10-31 08:37:15 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2021-10-31 09:17:11 -0400 |
commit | 1a6844ae32781f2117d46363ece697d509f6935d (patch) | |
tree | 89709950f96dd70091b1f0896cc91ef3b8c2f0fa /coverage/inorout.py | |
parent | 7589066bfe18bd6f26200895cc2e569128fafead (diff) | |
download | python-coveragepy-git-1a6844ae32781f2117d46363ece697d509f6935d.tar.gz |
fix: don't warn about already imported files for namespace packages #888
Ignore namespace packages in the already-imported check. #888
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 3bc7e54e..8badf4f7 100644 --- a/coverage/inorout.py +++ b/coverage/inorout.py @@ -479,6 +479,10 @@ class InOrOut: 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.has_dynamic_filename: # A plugin with dynamic filenames: the Python file |