beremiz

Parents ce1bfd04b3f6
Children b4a1ba9dbaf3
Prevent catching exception if exception handling was not enabled (or disabled by test test app).
  • +7 -3
    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()