summaryrefslogtreecommitdiff
path: root/src/python/m5/util
diff options
context:
space:
mode:
authorAndreas Sandberg <andreas.sandberg@arm.com>2019-01-25 12:04:31 +0000
committerAndreas Sandberg <andreas.sandberg@arm.com>2019-02-12 16:44:21 +0000
commit31dff7faa0a0be22e70376a49748cf4b8f1eb5f9 (patch)
treea3b3192f81e22fa6c7cd2b382bfbcd192cedc296 /src/python/m5/util
parentb3195c455bf5aed70d2543684f3c0bc7f36c8fcf (diff)
downloadgem5-31dff7faa0a0be22e70376a49748cf4b8f1eb5f9.tar.xz
python: Update use of exec to work with Python 3
Python 3 uses 'exec(code, globals)' instead of 'exec code in globals'. Switch to the newer syntax since it is supported by Python 2.7. Also, move check_tracing out of main to work around a bug in Python 2.7. Change-Id: I6d390160f58783e1b038a572b64cdf3ff09535fa Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com> Reviewed-on: https://gem5-review.googlesource.com/c/15986 Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Diffstat (limited to 'src/python/m5/util')
-rw-r--r--src/python/m5/util/jobfile.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/python/m5/util/jobfile.py b/src/python/m5/util/jobfile.py
index ad5b5ff5c..613289a81 100644
--- a/src/python/m5/util/jobfile.py
+++ b/src/python/m5/util/jobfile.py
@@ -417,7 +417,7 @@ def JobFile(jobfile):
raise AttributeError("Could not find file '%s'" % jobfile)
data = {}
- execfile(filename, data)
+ exec(compile(open(filename).read(), filename, 'exec'), data)
if 'conf' not in data:
raise ImportError('cannot import name conf from %s' % jobfile)
return data['conf']