From dde860f0b532b02be95bed76ca2deb2f266265fe Mon Sep 17 00:00:00 2001 From: McCloudS <64094529+McCloudS@users.noreply.github.com> Date: Tue, 1 Oct 2024 00:10:30 -0600 Subject: [PATCH] Switched to os.environ.get to prevent keyerror on empty env variable --- launcher.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/launcher.py b/launcher.py index 3e29a30..792e27a 100644 --- a/launcher.py +++ b/launcher.py @@ -131,11 +131,11 @@ def main(): print(f"Running launcher-{branch_name}.py for the '{branch_name}' branch.") os.execl(sys.executable, sys.executable, f"launcher{script_name}", *new_args) - # Set environment variables based on the parsed arguments - if convert_to_bool(os.environ['DEBUG']) not True: - os.environ['DEBUG'] = str(args.debug) - if convert_to_bool(os.environ['APPEND']) not True: - os.environ['DEBUG'] = str(args.append) +# Set environment variables based on the parsed arguments +if not convert_to_bool(os.environ.get('DEBUG', '')): + os.environ['DEBUG'] = str(args.debug) +if not convert_to_bool(os.environ.get('APPEND', '')): + os.environ['APPEND'] = str(args.append) if args.setup_bazarr: prompt_and_save_bazarr_env_variables()