summaryrefslogtreecommitdiff
path: root/src/python/m5/proxy.py
diff options
context:
space:
mode:
authorAndreas Sandberg <andreas.sandberg@arm.com>2019-01-26 09:23:16 +0000
committerAndreas Sandberg <andreas.sandberg@arm.com>2019-02-25 10:04:32 +0000
commitf4d3080f4586147b9ee962770110944467b26c0c (patch)
treefecd701421c6d678e1f6af5e745e540a85ace7ce /src/python/m5/proxy.py
parenta3c81f90556143dc6de1e8114c0a613b4010c05c (diff)
downloadgem5-f4d3080f4586147b9ee962770110944467b26c0c.tar.xz
python: Fix params/proxy import loop
There is a circular dependency between params and proxy at import time. This causes issues for Python 3. Add the imports to the specific methods with the dependencies to make the import happen when the method is executed instead. Change-Id: I770112fd3c07c395459e204976942bda3dc7236f Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com> Reviewed-on: https://gem5-review.googlesource.com/c/15993 Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com> Reviewed-by: Juha Jäykkä <juha.jaykka@arm.com>
Diffstat (limited to 'src/python/m5/proxy.py')
-rw-r--r--src/python/m5/proxy.py5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/python/m5/proxy.py b/src/python/m5/proxy.py
index 346ed928b..b939bc059 100644
--- a/src/python/m5/proxy.py
+++ b/src/python/m5/proxy.py
@@ -50,7 +50,6 @@ from __future__ import absolute_import
import copy
-from . import params
class BaseProxy(object):
def __init__(self, search_self, search_up):
@@ -235,6 +234,7 @@ class AllProxy(BaseProxy):
return 'all'
def isproxy(obj):
+ from . import params
if isinstance(obj, (BaseProxy, params.EthernetAddr)):
return True
elif isinstance(obj, (list, tuple)):
@@ -264,6 +264,3 @@ Self = ProxyFactory(search_self = True, search_up = False)
# limit exports on 'from proxy import *'
__all__ = ['Parent', 'Self']
-
-# see comment on imports at end of __init__.py.
-import params # for EthernetAddr