From 4e7fe439d7fe9cefb8cae5e79a1caa7aa4f0b45b Mon Sep 17 00:00:00 2001 From: Giacomo Travaglini Date: Fri, 28 Feb 2020 13:48:12 +0000 Subject: [PATCH] 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 --- src/arch/arm/isa/insts/mem.isa | 2 +- src/arch/isa_parser.py | 11 +++++------ src/arch/micro_asm.py | 1 - src/arch/mips/isa/formats/util.isa | 2 +- src/arch/power/isa/formats/util.isa | 2 +- src/arch/riscv/isa/formats/mem.isa | 2 +- src/arch/sparc/isa/formats/mem/swap.isa | 6 +++--- src/python/m5/util/code_formatter.py | 3 +-- 8 files changed, 13 insertions(+), 16 deletions(-) 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 (?