diff options
Diffstat (limited to 'src/python/m5/SimObject.py')
-rw-r--r-- | src/python/m5/SimObject.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/python/m5/SimObject.py b/src/python/m5/SimObject.py index 30c968380..3784c716e 100644 --- a/src/python/m5/SimObject.py +++ b/src/python/m5/SimObject.py @@ -861,7 +861,11 @@ class SimObject(object): found_obj = None for child in self._children.itervalues(): - if isinstance(child, ptype): + visited = False + if hasattr(child, '_visited'): + visited = getattr(child, '_visited') + + if isinstance(child, ptype) and not visited: if found_obj != None and child != found_obj: raise AttributeError, \ 'parent.any matched more than one: %s %s' % \ |