summaryrefslogtreecommitdiff
path: root/src/python/m5/util/multidict.py
diff options
context:
space:
mode:
authorGabe Black <gabeblack@google.com>2018-03-05 22:05:47 -0800
committerGabe Black <gabeblack@google.com>2018-03-06 23:39:01 +0000
commit0bb50e6745b35c785c4d8051eb43f6bc419fb924 (patch)
tree97dfd086d6e4b3f4252aec459091ff6dad19f2b6 /src/python/m5/util/multidict.py
parent10e5646dbbe46aa317ec568cb2a58968ca867575 (diff)
downloadgem5-0bb50e6745b35c785c4d8051eb43f6bc419fb924.tar.xz
scons: Switch from the print statement to the print function.
Starting with version 3, scons imposes using the print function instead of the print statement in code it processes. To get things building again, this change moves all python code within gem5 to use the function version. Another change by another author separately made this same change to the site_tools and site_init.py files. Change-Id: I2de7dc3b1be756baad6f60574c47c8b7e80ea3b0 Reviewed-on: https://gem5-review.googlesource.com/8761 Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com> Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Maintainer: Gabe Black <gabeblack@google.com>
Diffstat (limited to 'src/python/m5/util/multidict.py')
-rw-r--r--src/python/m5/util/multidict.py44
1 files changed, 23 insertions, 21 deletions
diff --git a/src/python/m5/util/multidict.py b/src/python/m5/util/multidict.py
index b5cd700ef..d22b1cbbc 100644
--- a/src/python/m5/util/multidict.py
+++ b/src/python/m5/util/multidict.py
@@ -26,6 +26,8 @@
#
# Authors: Nathan Binkert
+from __future__ import print_function
+
__all__ = [ 'multidict' ]
class multidict(object):
@@ -116,10 +118,10 @@ class multidict(object):
return default
def _dump(self):
- print 'multidict dump'
+ print('multidict dump')
node = self
while isinstance(node, multidict):
- print ' ', node.local
+ print(' ', node.local)
node = node.parent
def _dumpkey(self, key):
@@ -129,7 +131,7 @@ class multidict(object):
if key in node.local:
values.append(node.local[key])
node = node.parent
- print key, values
+ print(key, values)
if __name__ == '__main__':
test1 = multidict()
@@ -150,33 +152,33 @@ if __name__ == '__main__':
test2.setdefault('f', multidict)
- print 'test1>', test1.items()
- print 'test2>', test2.items()
- #print test1['a']
- print test1['b']
- print test1['c']
- print test1['d']
- print test1['e']
+ print('test1>', test1.items())
+ print('test2>', test2.items())
+ #print(test1['a'])
+ print(test1['b'])
+ print(test1['c'])
+ print(test1['d'])
+ print(test1['e'])
- print test2['a']
- #print test2['b']
- print test2['c']
- print test2['d']
- print test2['e']
+ print(test2['a'])
+ #print(test2['b'])
+ print(test2['c'])
+ print(test2['d'])
+ print(test2['e'])
for key in test2.iterkeys():
- print key
+ print(key)
test2.get('g', 'foo')
#test2.get('b')
test2.get('b', 'bar')
test2.setdefault('b', 'blah')
- print test1
- print test2
- print `test2`
+ print(test1)
+ print(test2)
+ print(`test2`)
- print len(test2)
+ print(len(test2))
test3['a'] = [ 0, 1, 2, 3 ]
- print test4
+ print(test4)