mirror of https://github.com/m-labs/artiq.git
language/environment: only call prepare automatically if it exists
This commit is contained in:
parent
7efd990541
commit
6aaf6c8789
|
@ -380,9 +380,10 @@ class EnvExperiment(Experiment, HasEnvironment):
|
||||||
Most experiment should derive from this class."""
|
Most experiment should derive from this class."""
|
||||||
def prepare(self):
|
def prepare(self):
|
||||||
"""The default prepare method calls prepare for all children, in the
|
"""The default prepare method calls prepare for all children, in the
|
||||||
order of instantiation."""
|
order of instantiation, if the child has a prepare method."""
|
||||||
for child in self.children:
|
for child in self.children:
|
||||||
child.prepare()
|
if hasattr(child, "prepare"):
|
||||||
|
child.prepare()
|
||||||
|
|
||||||
|
|
||||||
def is_experiment(o):
|
def is_experiment(o):
|
||||||
|
|
Loading…
Reference in New Issue