scons: Fixes to improve python 3 support.

Some simple fixes to improve python 3 compatability in scons.

Change-Id: I89aba6ed9d73ee733307c57e033c636029d9cb7a
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23264
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:
Gabe Black
2019-12-02 17:52:44 -08:00
parent 451ff4aa04
commit a39c8db854
4 changed files with 8 additions and 7 deletions

View File

@@ -49,7 +49,7 @@ try:
# 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
@@ -59,7 +59,7 @@ For more details, see:
# 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

View File

@@ -61,7 +61,7 @@ def common_config(env):
"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

View File

@@ -54,7 +54,7 @@ def install_style_hooks(env):
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