Params: Fix check for cycles in the configuration and clarify the comments/error message.
--HG-- extra : convert_revision : 8f35dde408fae874bcba1a248d32a22222d98c35
This commit is contained in:
parent
917ae9ec66
commit
6095dceb0c
|
@ -793,12 +793,14 @@ class SimObject(object):
|
||||||
# necessary to construct it. Does *not* recursively create
|
# necessary to construct it. Does *not* recursively create
|
||||||
# children.
|
# children.
|
||||||
def getCCObject(self):
|
def getCCObject(self):
|
||||||
params = self.getCCParams()
|
|
||||||
if not self._ccObject:
|
if not self._ccObject:
|
||||||
self._ccObject = -1 # flag to catch cycles in recursion
|
# Cycles in the configuration heirarchy are not supported. This
|
||||||
|
# will catch the resulting recursion and stop.
|
||||||
|
self._ccObject = -1
|
||||||
|
params = self.getCCParams()
|
||||||
self._ccObject = params.create()
|
self._ccObject = params.create()
|
||||||
elif self._ccObject == -1:
|
elif self._ccObject == -1:
|
||||||
raise RuntimeError, "%s: recursive call to getCCObject()" \
|
raise RuntimeError, "%s: Cycle found in configuration heirarchy." \
|
||||||
% self.path()
|
% self.path()
|
||||||
return self._ccObject
|
return self._ccObject
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue