Merge lp:~cjwatson/meliae/py3-obj-summary into lp:meliae

Proposed by Colin Watson
Status: Needs review
Proposed branch: lp:~cjwatson/meliae/py3-obj-summary
Merge into: lp:meliae
Diff against target: 19 lines (+2/-2)
1 file modified
meliae/loader.py (+2/-2)
To merge this branch: bzr merge lp:~cjwatson/meliae/py3-obj-summary
Reviewer Review Type Date Requested Status
Ioana Lasc (community) Approve
Meliae Development Team Pending
Review via email: mp+402727@code.launchpad.net

Commit message

Fix some _ObjSummary methods for Python 3.

Description of the change

by_size and by_count tried to use the "itervalues" method on an ordinary dict, which doesn't exist on Python 3.

To post a comment you must log in.
Revision history for this message
Ioana Lasc (ilasc) :
review: Approve

Unmerged revisions

232. By Colin Watson

Fix some _ObjSummary methods for Python 3.

by_size and by_count tried to use the "itervalues" method on an ordinary
dict, which doesn't exist on Python 3.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'meliae/loader.py'
2--- meliae/loader.py 2020-05-05 11:01:34 +0000
3+++ meliae/loader.py 2021-05-13 23:42:17 +0000
4@@ -195,13 +195,13 @@
5 return '\n'.join(out)
6
7 def by_size(self):
8- summaries = sorted(self.type_summaries.itervalues(),
9+ summaries = sorted(six.itervalues(self.type_summaries),
10 key=lambda x: (x.total_size, x.count),
11 reverse=True)
12 self.summaries = summaries
13
14 def by_count(self):
15- summaries = sorted(self.type_summaries.itervalues(),
16+ summaries = sorted(six.itervalues(self.type_summaries),
17 key=lambda x: (x.count, x.total_size),
18 reverse=True)
19 self.summaries = summaries

Subscribers

People subscribed via source and target branches

to all changes: