diff options
author | Mathieu Bridon <[email protected]> | 2018-07-06 12:20:26 +0200 |
---|---|---|
committer | Dylan Baker <[email protected]> | 2018-07-24 11:07:04 -0700 |
commit | 5530cb1296cef759ea2f94e581da0a4d853a9f5f (patch) | |
tree | 58a8bd7809d98f0fc8425615282b56b64c059086 /src/compiler/nir/nir_opcodes_h.py | |
parent | fdf946ffbfa23afde1b42fd8a342f5c42e413cc0 (diff) |
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 <[email protected]>
Reviewed-by: Eric Engestrom <[email protected]>
Reviewed-by: Dylan Baker <[email protected]>
Diffstat (limited to 'src/compiler/nir/nir_opcodes_h.py')
-rw-r--r-- | src/compiler/nir/nir_opcodes_h.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/compiler/nir/nir_opcodes_h.py b/src/compiler/nir/nir_opcodes_h.py index 8ad17c84d49..6b4e2fe052e 100644 --- a/src/compiler/nir/nir_opcodes_h.py +++ b/src/compiler/nir/nir_opcodes_h.py @@ -29,7 +29,7 @@ template = """\ #ifndef _NIR_OPCODES_ #define _NIR_OPCODES_ -<% opcode_names = sorted(opcodes.iterkeys()) %> +<% opcode_names = sorted(opcodes.keys()) %> typedef enum { % for name in opcode_names: |