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
=== modified file 'meliae/loader.py'
--- meliae/loader.py 2020-05-05 11:01:34 +0000
+++ meliae/loader.py 2021-05-13 23:42:17 +0000
@@ -195,13 +195,13 @@
195 return '\n'.join(out)195 return '\n'.join(out)
196196
197 def by_size(self):197 def by_size(self):
198 summaries = sorted(self.type_summaries.itervalues(),198 summaries = sorted(six.itervalues(self.type_summaries),
199 key=lambda x: (x.total_size, x.count),199 key=lambda x: (x.total_size, x.count),
200 reverse=True)200 reverse=True)
201 self.summaries = summaries201 self.summaries = summaries
202202
203 def by_count(self):203 def by_count(self):
204 summaries = sorted(self.type_summaries.itervalues(),204 summaries = sorted(six.itervalues(self.type_summaries),
205 key=lambda x: (x.count, x.total_size),205 key=lambda x: (x.count, x.total_size),
206 reverse=True)206 reverse=True)
207 self.summaries = summaries207 self.summaries = summaries

Subscribers

People subscribed via source and target branches

to all changes: