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/mesa/drivers | |
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/mesa/drivers')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_oa.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_oa.py b/src/mesa/drivers/dri/i965/brw_oa.py index 4c70f253d73..75382558e6d 100644 --- a/src/mesa/drivers/dri/i965/brw_oa.py +++ b/src/mesa/drivers/dri/i965/brw_oa.py @@ -653,7 +653,7 @@ def main(): c("\n") register_lengths = compute_register_lengths(set); - for reg_type, reg_length in register_lengths.iteritems(): + for reg_type, reg_length in register_lengths.items(): c("static struct brw_perf_query_register_prog {0}_{1}_{2}[{3}];".format(gen.chipset, set.underscore_name, reg_type, reg_length)) @@ -692,7 +692,7 @@ def main(): .c_offset = 46, """)) - for reg_type, reg_length in register_lengths.iteritems(): + for reg_type, reg_length in register_lengths.items(): c(".{0} = {1}_{2}_{3},".format(reg_type, gen.chipset, set.underscore_name, reg_type)) c(".n_{0} = 0, /* Determined at runtime */".format(reg_type)) |