summaryrefslogtreecommitdiff
path: root/coverage/python.py
diff options
context:
space:
mode:
Diffstat (limited to 'coverage/python.py')
-rw-r--r--coverage/python.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/coverage/python.py b/coverage/python.py
index 372347f5..2b16acab 100644
--- a/coverage/python.py
+++ b/coverage/python.py
@@ -135,7 +135,7 @@ class PythonFileReporter(FileReporter):
def __init__(self, morf, coverage=None):
self.coverage = coverage
- if hasattr(morf, '__file__'):
+ if hasattr(morf, '__file__') and morf.__file__:
filename = morf.__file__
elif isinstance(morf, types.ModuleType):
# A module should have had .__file__, otherwise we can't use it.