summaryrefslogtreecommitdiff
path: root/coverage/execfile.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2015-10-13 07:32:24 -0400
committerNed Batchelder <ned@nedbatchelder.com>2015-10-13 07:32:24 -0400
commit086aec37d70f1a01c0a40ffb55f5f16f98b214f7 (patch)
tree576b9baa148cbc4c47d23ce4195efa9946a1f5ce /coverage/execfile.py
parente5df01cadf622629ba8d418e96f8b14b468a551a (diff)
downloadpython-coveragepy-086aec37d70f1a01c0a40ffb55f5f16f98b214f7.tar.gz
Fix explicit imports of __init__. #410
Diffstat (limited to 'coverage/execfile.py')
-rw-r--r--coverage/execfile.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/coverage/execfile.py b/coverage/execfile.py
index 844c11b..3e20a52 100644
--- a/coverage/execfile.py
+++ b/coverage/execfile.py
@@ -41,7 +41,7 @@ if importlib_util_find_spec:
raise NoSource("No module named %r" % (modulename,))
pathname = spec.origin
packagename = spec.name
- if pathname.endswith("__init__.py"):
+ if pathname.endswith("__init__.py") and not modulename.endswith("__init__"):
mod_main = modulename + ".__main__"
spec = importlib_util_find_spec(mod_main)
if not spec: