Prevent catching exception if exception handling was not enabled (or disabled by test test app).
--- 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()