summaryrefslogtreecommitdiff
path: root/coverage/python.py
diff options
context:
space:
mode:
authorDirk Thomas <dthomas@osrfoundation.org>2016-10-17 14:12:10 -0700
committerDirk Thomas <dthomas@osrfoundation.org>2016-10-17 14:12:10 -0700
commit9f46d586fc05a0f69c1989411f8e0ad60b4f40d1 (patch)
tree9313fe3b502fbb3b6b1e28f5f9fccd104d400110 /coverage/python.py
parentf1df880e7582638cb5ddb3227e53f8206052143d (diff)
downloadpython-coveragepy-git-9f46d586fc05a0f69c1989411f8e0ad60b4f40d1.tar.gz
fix name for module in __init__.py file
--HG-- branch : fix_init_name
Diffstat (limited to 'coverage/python.py')
-rw-r--r--coverage/python.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/coverage/python.py b/coverage/python.py
index 601318c5..7109ece0 100644
--- a/coverage/python.py
+++ b/coverage/python.py
@@ -118,7 +118,10 @@ class PythonFileReporter(FileReporter):
if hasattr(morf, '__name__'):
name = morf.__name__
- name = name.replace(".", os.sep) + ".py"
+ name = name.replace(".", os.sep)
+ if filename.endswith('__init__.py'):
+ name += os.sep + '__init__'
+ name += '.py'
name = files.unicode_filename(name)
else:
name = files.relative_filename(filename)