python: Replace deprecated repr syntax
authorAndreas Sandberg <andreas.sandberg@arm.com>
Fri, 25 Jan 2019 18:40:19 +0000 (18:40 +0000)
committerAndreas Sandberg <andreas.sandberg@arm.com>
Wed, 13 Feb 2019 09:52:37 +0000 (09:52 +0000)
Change-Id: I5f9538cf2ca5ee17c51e7c5388d3aef363fcfa54
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/15989
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
src/python/m5/util/grammar.py
src/python/m5/util/multidict.py
src/python/m5/util/sorteddict.py

index fcd8df2c9d5b14c21760574e3305619e9a443f8b..2d9e82cd66feae882685d1522de759291967aa10 100644 (file)
@@ -134,5 +134,5 @@ class Grammar(object):
 
     def t_error(self, t):
         msg = "Illegal character %s @ %d:%d" % \
-            (`t.value[0]`, t.lineno, t.lexpos)
+            (repr(t.value[0]), t.lineno, t.lexpos)
         raise ParseError(msg, t)
index 58898a5d2b9ef870ce8a89f6d97cf2134c4d525e..5cc13eefa2db0d1a12f2de016c94945110d147ec 100644 (file)
@@ -40,7 +40,7 @@ class multidict(object):
         return str(dict(self.items()))
 
     def __repr__(self):
-        return `dict(self.items())`
+        return repr(dict(list(self.items())))
 
     def __contains__(self, key):
         return key in self.local or key in self.parent
@@ -175,7 +175,7 @@ if __name__ == '__main__':
     test2.setdefault('b', 'blah')
     print(test1)
     print(test2)
-    print(`test2`)
+    print(repr(test2))
 
     print(len(test2))
 
index abe28376da8134fe7620a40cf4c1d7ded80baf61..dd534b3cba4393fcfbbb00df0c30afcbe4252aad 100644 (file)
@@ -214,7 +214,7 @@ if __name__ == '__main__':
     d['y'] = 26
     display(d)
 
-    print(`d`)
+    print(repr(d))
 
     print(d.copy())