python: Make iterator handling Python 3 compatible

Many functions that used to return lists (e.g., dict.items()) now
return iterators and their iterator counterparts (e.g.,
dict.iteritems()) have been removed. Switch calls to the Python 2.7
iterator methods to use the Python 3 equivalent and add explicit list
conversions where necessary.

Change-Id: I0c18114955af8f4932d81fb689a0adb939dafaba
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/15992
Reviewed-by: Juha Jäykkä <juha.jaykka@arm.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
This commit is contained in:
Andreas Sandberg
2019-01-26 09:19:22 +00:00
parent 8e5d168332
commit 7d71f6641f
18 changed files with 74 additions and 97 deletions

View File

@@ -296,11 +296,11 @@ if __name__ == '__main__':
f(' $y')
f('''$__file__:$__line__
{''')
f("${{', '.join(str(x) for x in xrange(4))}}")
f("${{', '.join(str(x) for x in range(4))}}")
f('${x}')
f('$x')
f.indent()
for i in xrange(5):
for i in range(5):
f('$x')
f('$i')
f('$0', "zero")