summaryrefslogtreecommitdiff
path: root/configs/common/CpuConfig.py
diff options
context:
space:
mode:
authorAndreas Sandberg <andreas.sandberg@arm.com>2019-02-25 11:55:02 +0000
committerAndreas Sandberg <andreas.sandberg@arm.com>2019-03-18 15:13:52 +0000
commitfe3e8084959a6910f4c8d075c5c03e40d0269527 (patch)
tree7e4e43608dfd8d3d5544177e439f57733f3837d8 /configs/common/CpuConfig.py
parent9e22a2ab603d743b187108986cfbeba07c0c0b8d (diff)
downloadgem5-fe3e8084959a6910f4c8d075c5c03e40d0269527.tar.xz
configs: Use absolute import paths
Use absoluate import paths to be Python 3 compatible. This also imports absolute_import from __future__ to ensure that Python 2.7 behaves the same way as Python 3. Change-Id: Ica06ed95814e9cd3e768b3e1785075e36f6e56d0 Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com> Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/16708 Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Diffstat (limited to 'configs/common/CpuConfig.py')
-rw-r--r--configs/common/CpuConfig.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/configs/common/CpuConfig.py b/configs/common/CpuConfig.py
index 80e3766ef..831287ddc 100644
--- a/configs/common/CpuConfig.py
+++ b/configs/common/CpuConfig.py
@@ -36,6 +36,7 @@
# Authors: Andreas Sandberg
from __future__ import print_function
+from __future__ import absolute_import
from m5 import fatal
import m5.objects
@@ -134,7 +135,8 @@ from m5.defines import buildEnv
from importlib import import_module
for package in [ "generic", buildEnv['TARGET_ISA']]:
try:
- package = import_module(".cores." + package, package=__package__)
+ package = import_module(".cores." + package,
+ package=__name__.rpartition('.')[0])
except ImportError:
# No timing models for this ISA
continue