python: Better iterate over dictionaries
authorMathieu Bridon <bochecha@daitauha.fr>
Fri, 6 Jul 2018 10:20:26 +0000 (12:20 +0200)
committerDylan Baker <dylan@pnwbakers.com>
Tue, 24 Jul 2018 18:07:04 +0000 (11:07 -0700)
commit5530cb1296cef759ea2f94e581da0a4d853a9f5f
tree58a8bd7809d98f0fc8425615282b56b64c059086
parentfdf946ffbfa23afde1b42fd8a342f5c42e413cc0
python: Better iterate over dictionaries

In Python 2, dictionaries have 2 sets of methods to iterate over their
keys and values: keys()/values()/items() and iterkeys()/itervalues()/iteritems().

The former return lists while the latter return iterators.

Python 3 dropped the method which return lists, and renamed the methods
returning iterators to keys()/values()/items().

Using those names makes the scripts compatible with both Python 2 and 3.

Signed-off-by: Mathieu Bridon <bochecha@daitauha.fr>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
12 files changed:
src/amd/vulkan/radv_entrypoints_gen.py
src/compiler/nir/nir_algebraic.py
src/compiler/nir/nir_builder_opcodes_h.py
src/compiler/nir/nir_constant_expressions.py
src/compiler/nir/nir_intrinsics_c.py
src/compiler/nir/nir_opcodes_c.py
src/compiler/nir/nir_opcodes_h.py
src/intel/genxml/gen_bits_header.py
src/intel/vulkan/anv_entrypoints_gen.py
src/mapi/glapi/gen/gl_XML.py
src/mapi/glapi/gen/gl_gentable.py
src/mesa/drivers/dri/i965/brw_oa.py