diff options
Diffstat (limited to 'rumba/model.py')
-rw-r--r-- | rumba/model.py | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/rumba/model.py b/rumba/model.py index 99bf5ed..faf353c 100644 --- a/rumba/model.py +++ b/rumba/model.py @@ -615,12 +615,13 @@ class Experiment: raise Exception('run_prototype() method not implemented') def run(self): - # Realize the experiment testbed (testbed-specific) - self.testbed.swap_in(self) - - # Run the experiment using the prototype (prototype-specific) - self.run_prototype() - - # Undo the testbed (testbed-specific) - self.testbed.swap_out(self) + try: + # Realize the experiment testbed (testbed-specific) + self.testbed.swap_in(self) + + # Run the experiment using the prototype (prototype-specific) + self.run_prototype() + finally: + # No matter what happens, undo the testbed (testbed-specific) + self.testbed.swap_out(self) |