diff options
-rw-r--r-- | changes/bug_dont_raise_nosectionerror | 2 | ||||
-rw-r--r-- | src/launcher.py | 21 |
2 files changed, 13 insertions, 10 deletions
diff --git a/changes/bug_dont_raise_nosectionerror b/changes/bug_dont_raise_nosectionerror new file mode 100644 index 0000000..fbc2306 --- /dev/null +++ b/changes/bug_dont_raise_nosectionerror @@ -0,0 +1,2 @@ + o Avoid the try/except idiom when accessing configs to avoid messing + with the client traceback. Fixes #5007.
\ No newline at end of file diff --git a/src/launcher.py b/src/launcher.py index b62bd23..2a43e54 100644 --- a/src/launcher.py +++ b/src/launcher.py @@ -4,21 +4,22 @@ import time import threading import ConfigParser -from leap.bitmask.app import main as leap_client +from leap.bitmask.app import main as bitmask_client from leap.common.events import server from thandy.ClientCLI import update as thandy_update bundles_per_platform = { - "Windows" : "/bundleinfo/LEAPClient-win/", - "Darwin" : "", - "Linux" : "/bundleinfo/LEAPClient/", + "Windows": "/bundleinfo/LEAPClient-win/", + "Darwin": "", + "Linux": "/bundleinfo/LEAPClient/", } GENERAL_SECTION = "General" UPDATES_KEY = "Updates" + class Thandy(threading.Thread): def run(self): while True: @@ -50,16 +51,16 @@ if __name__ == "__main__": config.read("launcher.conf") launch_thandy = False - try: + + has_config = config.has_section(GENERAL_SECTION) and \ + config.has_option(GENERAL_SECTION, UPDATES_KEY) + + if has_config: launch_thandy = config.getboolean(GENERAL_SECTION, UPDATES_KEY) - except ConfigParser.NoSectionError as ns: - pass - except ConfigParser.NoOptionError as no: - pass if launch_thandy: thandy_thread = Thandy() thandy_thread.daemon = True thandy_thread.start() - leap_client() + bitmask_client() |