python: Switch to using open instead of file
Python 3 doesn't support the file(name, mode) syntax which has been deprecated in favour of open. Change-Id: I35ef8690d97a5243860a64ff985fd22fa86253f1 Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com> Reviewed-on: https://gem5-review.googlesource.com/c/15985 Reviewed-by: Gabe Black <gabeblack@google.com> Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
This commit is contained in:
@@ -67,7 +67,7 @@ class CodeImporter(object):
|
||||
|
||||
override = os.environ.get('M5_OVERRIDE_PY_SOURCE', 'false').lower()
|
||||
if override in ('true', 'yes') and os.path.exists(abspath):
|
||||
src = file(abspath, 'r').read()
|
||||
src = open(abspath, 'r').read()
|
||||
code = compile(src, abspath, 'exec')
|
||||
|
||||
if os.path.basename(srcfile) == '__init__.py':
|
||||
|
||||
Reference in New Issue
Block a user