mirror of
https://github.com/openvswitch/ovs
synced 2025-10-13 14:07:02 +00:00
python: Convert dict iterators.
In Python 2, dict.items(), dict.keys(), and dict.values() returned a list. dict.iteritems(), dict.iterkeys(), and dict.itervalues() returned an iterator. As of Python 3, dict.iteritems(), dict.itervalues(), and dict.iterkeys() are gone. items(), keys(), and values() now return an iterator. In the case where we want an iterator, we now use the six.iter*() helpers. If we want a list, we explicitly create a list from the iterator. Signed-off-by: Russell Bryant <russell@ovn.org> Acked-by: Ben Pfaff <blp@ovn.org>
This commit is contained in:
@@ -85,7 +85,7 @@ class _SelectSelect(object):
|
||||
events_dict[fd] = events_dict.get(fd, 0) | (POLLERR |
|
||||
POLLHUP |
|
||||
POLLNVAL)
|
||||
return events_dict.items()
|
||||
return list(events_dict.items())
|
||||
|
||||
|
||||
SelectPoll = _SelectSelect
|
||||
|
Reference in New Issue
Block a user