DebugClients/Python/coverage/python.py

branch
maintenance
changeset 6693
3629d88ae235
parent 6649
f1b3a73831c9
equal deleted inserted replaced
6647:2a11e1b2dcbe 6693:3629d88ae235
133 """Report support for a Python file.""" 133 """Report support for a Python file."""
134 134
135 def __init__(self, morf, coverage=None): 135 def __init__(self, morf, coverage=None):
136 self.coverage = coverage 136 self.coverage = coverage
137 137
138 if hasattr(morf, '__file__'): 138 if hasattr(morf, '__file__') and morf.__file__:
139 filename = morf.__file__ 139 filename = morf.__file__
140 elif isinstance(morf, types.ModuleType): 140 elif isinstance(morf, types.ModuleType):
141 # A module should have had .__file__, otherwise we can't use it. 141 # A module should have had .__file__, otherwise we can't use it.
142 # This could be a PEP-420 namespace package. 142 # This could be a PEP-420 namespace package.
143 raise CoverageException("Module {0} has no file".format(morf)) 143 raise CoverageException("Module {0} has no file".format(morf))

eric ide

mercurial