From 6aaf6c87894eac10c07150125682db7025918789 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Fri, 9 Sep 2016 09:06:59 +0800 Subject: [PATCH] language/environment: only call prepare automatically if it exists --- artiq/language/environment.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/artiq/language/environment.py b/artiq/language/environment.py index 3a3bed0e4..2fd2b39b1 100644 --- a/artiq/language/environment.py +++ b/artiq/language/environment.py @@ -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):