From d615fd0af46e5e7ee0d63e00244e4fcaa255c6f2 Mon Sep 17 00:00:00 2001 From: Stephen Steneker Date: Fri, 7 Jun 2019 17:24:08 +1000 Subject: [PATCH] Fix #688: mplotqueries with --group-limit throws error in Python 3.x (#689) --- mtools/util/grouping.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mtools/util/grouping.py b/mtools/util/grouping.py index e950050c..4545a886 100644 --- a/mtools/util/grouping.py +++ b/mtools/util/grouping.py @@ -117,10 +117,10 @@ def sort_by_size(self, group_limit=None, discard_others=False, # now group together all groups that did not make the limit if not discard_others: - group_keys = self.groups.keys()[group_limit - 1:] + group_keys = list(self.groups.keys())[group_limit - 1:] self.groups.setdefault(others_label, list()) else: - group_keys = self.groups.keys()[group_limit:] + group_keys = list(self.groups.keys())[group_limit:] # only go to second last (-1), since the 'others' group is now last for g in group_keys: