# HG changeset patch # User Edouard Tisserant # Date 1519896497 -3600 # Node ID 372ec456664cf60972b332800cc033c5f57b639c # Parent ce1bfd04b3f6690edb8ceb8b035d20b55cceba58 Prevent catching exception if exception handling was not enabled (or disabled by test test app). diff -r ce1bfd04b3f6 -r 372ec456664c Beremiz.py --- a/Beremiz.py Thu Mar 01 09:41:12 2018 +0100 +++ b/Beremiz.py Thu Mar 01 10:28:17 2018 +0100 @@ -48,6 +48,7 @@ self.splashPath = self.Bpath("images", "splash.png") self.modules = ["BeremizIDE"] self.debug = os.path.exists("BEREMIZ_DEBUG") + self.handle_exception = None def Bpath(self, *args): return os.path.join(self.app_dir, *args) @@ -198,10 +199,13 @@ self.CreateUI() self.CloseSplash() self.ShowUI() - # except (KeyboardInterrupt, SystemExit): - # raise + except (KeyboardInterrupt, SystemExit): + raise except Exception: - self.handle_exception(*sys.exc_info(), exit=True) + if self.handle_exception is not None: + self.handle_exception(*sys.exc_info(), exit=True) + else: + raise def MainLoop(self): self.app.MainLoop()