From: Giacomo Travaglini Date: Fri, 28 Feb 2020 13:48:12 +0000 (+0000) Subject: misc: string.join has been removed in python3 X-Git-Tag: v20.0.0.0~409 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4e7fe439d7fe9cefb8cae5e79a1caa7aa4f0b45b;p=gem5.git misc: string.join has been removed in python3 In general string methods are deprecated in favour of str ones Change-Id: Ifba04e0b70be29e5a82a67cf11837f740de57e32 Signed-off-by: Giacomo Travaglini Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/26244 Reviewed-by: Jason Lowe-Power Maintainer: Jason Lowe-Power Tested-by: kokoro --- diff --git a/src/arch/arm/isa/insts/mem.isa b/src/arch/arm/isa/insts/mem.isa index 14a3267a0..0087a24dc 100644 --- a/src/arch/arm/isa/insts/mem.isa +++ b/src/arch/arm/isa/insts/mem.isa @@ -57,7 +57,7 @@ let {{ # This shouldn't be part of the eaCode, but until the exec templates # are converted over it's the easiest place to put it. eaCode += '\n unsigned memAccessFlags = ' - eaCode += (string.join(memFlags, '|') + ';') + eaCode += ('|'.join(memFlags) + ';') codeBlobs["ea_code"] = eaCode diff --git a/src/arch/isa_parser.py b/src/arch/isa_parser.py index 8d0fee22d..49b3b0729 100755 --- a/src/arch/isa_parser.py +++ b/src/arch/isa_parser.py @@ -41,7 +41,6 @@ from __future__ import with_statement, print_function import os import sys import re -import string import inspect, traceback # get type names from types import * @@ -231,7 +230,7 @@ class Format(object): self.params = params label = 'def format ' + id self.user_code = compile(fixPythonIndentation(code), label, 'exec') - param_list = string.join(params, ", ") + param_list = ", ".join(params) f = '''def defInst(_code, _context, %s): my_locals = vars().copy() exec _code in _context, my_locals @@ -1399,7 +1398,7 @@ def makeFlagConstructor(flag_list): i += 1 pre = '\n\tflags[' post = '] = true;' - code = pre + string.join(flag_list, post + pre) + post + code = pre + (post + pre).join(flag_list) + post return code # Assume all instruction flags are of the form 'IsFoo' @@ -1584,7 +1583,7 @@ class ISAParser(Grammar): # file where it was included. self.fileNameStack = Stack() - symbols = ('makeList', 're', 'string') + symbols = ('makeList', 're') self.exportContext = dict([(s, eval(s)) for s in symbols]) self.maxInstSrcRegs = 0 @@ -2597,7 +2596,7 @@ StaticInstPtr (?