From 8dc17fbd9ca0eb4ca2d7b6095a656b279e3f9a30 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Fri, 9 Feb 2024 21:05:54 -0300 Subject: Make Discord errors non-fatal (regardless of the error) --- __main__.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/__main__.py b/__main__.py index aa5cd49..0cbb850 100755 --- a/__main__.py +++ b/__main__.py @@ -19,6 +19,7 @@ OBFS = uuid.getnode() % 256 # Get a number which *usually* doesn't change OBFS = 185 # <- For debugging (FIXME ^ above didn't held up in practice) # TODO: Maybe we can do len() for the absolute path to this script # Then % 256 it so we always have a valid unchanging obfuscation? >_> +# TODO: Make a .ico for this, and pyinstaller -i? (--onefile) print("Obfuscation key = %d" % OBFS) # <- Just to not leave it in plain text ## Internal wrapper for preferences @@ -103,9 +104,10 @@ if pref["discord"]: _rpc = None print("Failed to load Discord RPC!\n%s" % err) except (FileNotFoundError, discordrpc.exceptions.Error): - if not sys.platform.startswith('win'): - raise - else: + err = traceback.format_exc().split("\n")[-2] + _rpc = None + print("Failed to load Discord RPC!\n%s" % err) + except: err = traceback.format_exc().split("\n")[-2] _rpc = None print("Failed to load Discord RPC!\n%s" % err) -- cgit v1.2.3-60-g2f50