2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-31 14:25:26 +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:
Russell Bryant
2015-12-14 15:13:20 -05:00
parent f7683a7277
commit cb96c1b27e
12 changed files with 81 additions and 67 deletions

View File

@@ -89,7 +89,7 @@ def inline_xml_to_nroff(node, font, to_upper=False, newline='\n'):
s += node.attributes['db'].nodeValue
else:
raise error.Error("'ref' lacks required attributes: %s"
% node.attributes.keys())
% list(node.attributes.keys()))
return s + font
elif node.tagName in ['var', 'dfn', 'i']:
s = r'\fI'