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

@@ -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