diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2012-11-16 20:39:21 -0500 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2012-11-16 20:39:21 -0500 |
commit | abc4c287d8a1d2ecfab6ece3d1a08ecf8d115564 (patch) | |
tree | 737b4b2ac16ebcd9076e174f842159773d731b49 /coverage/results.py | |
parent | 74714c35de79953fb9c0e7c604c23fb33f83c502 (diff) | |
download | python-coveragepy-git-abc4c287d8a1d2ecfab6ece3d1a08ecf8d115564.tar.gz |
Use iitems() to avoid lists of dict items on py2.
Diffstat (limited to 'coverage/results.py')
-rw-r--r-- | coverage/results.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/coverage/results.py b/coverage/results.py index d7e2a9d1..b39966ca 100644 --- a/coverage/results.py +++ b/coverage/results.py @@ -2,7 +2,7 @@ import os -from coverage.backward import set, sorted # pylint: disable=W0622 +from coverage.backward import iitems, set, sorted # pylint: disable=W0622 from coverage.misc import format_lines, join_regex, NoSource from coverage.parser import CodeParser @@ -42,7 +42,7 @@ class Analysis(object): n_branches = self.total_branches() mba = self.missing_branch_arcs() n_missing_branches = sum( - [len(v) for k,v in mba.items() if k not in self.missing] + [len(v) for k,v in iitems(mba) if k not in self.missing] ) else: n_branches = n_missing_branches = 0 @@ -109,7 +109,7 @@ class Analysis(object): def branch_lines(self): """Returns a list of line numbers that have more than one exit.""" exit_counts = self.parser.exit_counts() - return [l1 for l1,count in exit_counts.items() if count > 1] + return [l1 for l1,count in iitems(exit_counts) if count > 1] def total_branches(self): """How many total branches are there?""" |