In Python 3 OrderedDict.keys() are not indexable

We could always cast counts.keys() to a list, from the dictionary view they
are but a more efficient way of doing this is to simply pop the items from
our result list as we traverse the returned iterable dictionary view.
fix/5-genkeyinput-default-type
Mikael Nordfeldth 2013-07-24 14:37:09 +02:00
parent 43191ab4af
commit 9015aab8ea
1 changed files with 2 additions and 2 deletions

View File

@ -1056,8 +1056,8 @@ class ImportResult(object):
'status': self._problem_reason[reason]})
elif key == "IMPORT_RES":
import_res = value.split()
for x in range(len(self.counts)):
self.counts[self.counts.keys()[x]] = int(import_res[x])
for x in self.counts.keys():
self.counts[x] = int(import_res.pop(0))
elif key == "KEYEXPIRED":
res = {'fingerprint': None,
'status': 'Key expired'}