for i in range(len(l)+offs, 0, -1):
if l[i] == elt:
return i
- raise ValueError, "element not found"
+ raise ValueError("element not found")
# Take a list of paths (or SCons Nodes) and return a list with all
# paths made absolute and ~-expanded. Paths will be interpreted
# verify that this stuff works
if not conf.CheckHeader('Python.h', '<>'):
- error("Check failed for Python.h header in", py_includes, "\n"
+ error("Check failed for Python.h header in",
+ ' '.join(py_includes), "\n"
"Two possible reasons:\n"
"1. Python headers are not installed (You can install the "
"package python-dev on Ubuntu and RedHat)\n"
# Add self to dict
if name in CpuModel.dict:
- raise AttributeError, "CpuModel '%s' already registered" % name
+ raise AttributeError("CpuModel '%s' already registered" % name)
CpuModel.dict[name] = self
Export('CpuModel')
# 0.98, and the second will fail for 0.98.0
EnsureSConsVersion(0, 98)
EnsureSConsVersion(0, 98, 1)
-except SystemExit, e:
+except SystemExit as e:
print("""
For more details, see:
http://gem5.org/Dependencies
# pybind11 requires python 2.7
try:
EnsurePythonVersion(2, 7)
-except SystemExit, e:
+except SystemExit as e:
print ("""
You can use a non-default installation of the Python interpreter by
rearranging your PATH so that scons finds the non-default 'python' and
"M5", # M5 configuration (e.g., path to kernels)
]
- for key,val in sorted(os.environ.iteritems()):
+ for key,val in sorted(os.environ.items()):
if key in use_vars or \
any([key.startswith(prefix) for prefix in use_prefixes]):
env['ENV'][key] = val
try:
gitdir = env.Dir(readCommand(
["git", "rev-parse", "--git-dir"]).strip("\n"))
- except Exception, e:
+ except Exception as e:
print("Warning: Failed to find git repo directory: %s" % e)
return