fix TypeError: 'itertools.imap' object has no attribute 'getitem' #2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We were having python exceptions like this:
TypeError: 'itertools.imap' object has no attribute 'getitem'
for lines
and
I.e. each element from dot11_elt_dict is an itertools.imap object, for example:
{'59': <itertools.imap object at 0xffff79cb4c10>, '48': <itertools.imap object at 0xffff79cb4950>, '33': <itertools.imap object at 0xffff79cb4890>, '45': <itertools.imap object at 0xffff79cb4a10>, '191': <itertools.imap object at 0xffff79cb4b10>, '36': <itertools.imap object at 0xffff79cb4910>, '1': <itertools.imap object at 0xffff79cb4810>, '0': <itertools.imap object at 0xffff79cb4790>, '127': <itertools.imap object at 0xffff79cb4a90>, '221': <itertools.imap object at 0xffff79cb4b90>, '220': <itertools.imap object at 0xffff79cb4c90>}
This fix creates lists needed and puts elements from itertools.imap objects onto these lists, preserving order.
We can then access the elements with [id] without producing an error.