From e45ea8f7c49e3dbbadc9a7ec779703fc57adce78 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Tue, 13 Oct 2015 07:32:24 -0400 Subject: Fix explicit imports of __init__. #410 --- coverage/execfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'coverage/execfile.py') diff --git a/coverage/execfile.py b/coverage/execfile.py index 844c11bc..3e20a527 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: -- cgit v1.2.1