Skip to content
This repository has been archived by the owner on Aug 29, 2022. It is now read-only.

Commit

Permalink
Merge pull request #6 from LRGH/master
Browse files Browse the repository at this point in the history
Adapt to post-2015 coverage.py
  • Loading branch information
mgedmin committed Apr 24, 2017
2 parents 9cf9070 + f589365 commit 60d8127
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/z3c/coverage/coveragereport.py
Expand Up @@ -262,7 +262,13 @@ def create_tree_from_coverage(cov, strip_prefix=None, path_aliases=None):
short_name = short_name.replace('/', os.path.sep)
short_name = short_name.lstrip(os.path.sep)
else:
short_name = cov.file_locator.relative_filename(filename)
if hasattr(cov, 'file_locator'):
# Old version, before June 2015
# https://bitbucket.org/ned/coveragepy/commits/0f4918ab6892156399c87c07f831a4e76bb20e9a
short_name = cov.file_locator.relative_filename(filename)
else:
from coverage import files
short_name = files.relative_filename(filename)
tree_index = filename_to_list(short_name.replace(os.path.sep, '.'))
if 'tests' in tree_index or 'ftests' in tree_index:
continue
Expand Down

0 comments on commit 60d8127

Please sign in to comment.