From b3195c455bf5aed70d2543684f3c0bc7f36c8fcf Mon Sep 17 00:00:00 2001 From: Andreas Sandberg Date: Fri, 25 Jan 2019 12:03:21 +0000 Subject: 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 Reviewed-on: https://gem5-review.googlesource.com/c/15985 Reviewed-by: Gabe Black Reviewed-by: Giacomo Travaglini --- src/python/importer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/python/importer.py') diff --git a/src/python/importer.py b/src/python/importer.py index 60b9b35cd..c54fb4957 100644 --- a/src/python/importer.py +++ b/src/python/importer.py @@ -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': -- cgit v1.2.3