summaryrefslogtreecommitdiff
path: root/coverage/control.py
diff options
context:
space:
mode:
authorBuck Golemon <buck@yelp.com>2014-11-14 17:19:00 -0800
committerBuck Golemon <buck@yelp.com>2014-11-14 17:19:00 -0800
commite18b789e06497194a37c86d7dcb8ad094368f4ac (patch)
treeb1da0a4d14dff7c77e2bb13168a2ef990c0d690a /coverage/control.py
parent0166806295cdfcc525534d25e331e1f9852cbd5f (diff)
downloadpython-coveragepy-e18b789e06497194a37c86d7dcb8ad094368f4ac.tar.gz
pypy3 sets sys.__file__ to a nonexistant file
Diffstat (limited to 'coverage/control.py')
-rw-r--r--coverage/control.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/coverage/control.py b/coverage/control.py
index 7a85103..1b932da 100644
--- a/coverage/control.py
+++ b/coverage/control.py
@@ -661,7 +661,10 @@ class Coverage(object):
for pkg in self.not_imported:
if pkg not in sys.modules:
self._warn("Module %s was never imported." % pkg)
- elif not hasattr(sys.modules[pkg], '__file__'):
+ elif not (
+ hasattr(sys.modules[pkg], '__file__') and
+ os.path.exists(sys.modules[pkg].__file__)
+ ):
self._warn("Module %s has no Python source." % pkg)
else:
raise AssertionError('''\