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 <giacomo.travaglini@arm.com> Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/26244 Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Maintainer: Jason Lowe-Power <jason@lowepower.com> Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
@@ -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
|
||||
(?<!\w) # neg. lookbehind assertion: prevent partial matches
|
||||
((%s)(?:_(%s))?) # match: operand with optional '_' then suffix
|
||||
(?!\w) # neg. lookahead assertion: prevent partial matches
|
||||
''' % (string.join(operands, '|'), string.join(extensions, '|'))
|
||||
''' % ('|'.join(operands), '|'.join(extensions))
|
||||
|
||||
self.operandsRE = re.compile(operandsREString, re.MULTILINE|re.VERBOSE)
|
||||
|
||||
@@ -2605,7 +2604,7 @@ StaticInstPtr
|
||||
# groups are returned (base and ext, not full name as above).
|
||||
# Used for subtituting '_' for '.' to make C++ identifiers.
|
||||
operandsWithExtREString = r'(?<!\w)(%s)_(%s)(?!\w)' \
|
||||
% (string.join(operands, '|'), string.join(extensions, '|'))
|
||||
% ('|'.join(operands), '|'.join(extensions))
|
||||
|
||||
self.operandsWithExtRE = \
|
||||
re.compile(operandsWithExtREString, re.MULTILINE)
|
||||
|
||||
Reference in New Issue
Block a user