2
0
mirror of https://github.com/m-labs/artiq.git synced 2024-12-29 05:03:34 +08:00

language/environment: only call prepare automatically if it exists

This commit is contained in:
Sebastien Bourdeauducq 2016-09-09 09:06:59 +08:00
parent 7efd990541
commit 6aaf6c8789

View File

@ -380,9 +380,10 @@ class EnvExperiment(Experiment, HasEnvironment):
Most experiment should derive from this class."""
def prepare(self):
"""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:
child.prepare()
if hasattr(child, "prepare"):
child.prepare()
def is_experiment(o):