python: clarify SimObject error message (#1625)
This adds more detail to the error message that is thrown when an orphan node is instantiated.
This commit is contained in:
committed by
GitHub
parent
f5858fe81f
commit
1ee924a067
@@ -1259,7 +1259,9 @@ class SimObject(metaclass=MetaSimObject):
|
||||
if not self._ccObject:
|
||||
# Make sure this object is in the configuration hierarchy
|
||||
if not self._parent and not isRoot(self):
|
||||
raise RuntimeError("Attempt to instantiate orphan node")
|
||||
raise RuntimeError(
|
||||
f"Attempt to instantiate orphan node {self}"
|
||||
)
|
||||
# Cycles in the configuration hierarchy are not supported. This
|
||||
# will catch the resulting recursion and stop.
|
||||
self._ccObject = -1
|
||||
|
||||
Reference in New Issue
Block a user