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
parent
43191ab4af
commit
9015aab8ea
|
@ -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'}
|
||||
|
|
Loading…
Reference in New Issue