Switched to os.environ.get to prevent keyerror on empty env variable

This commit is contained in:
McCloudS authored and GitHub committed 2024-10-01 00:10:30 -06:00
1 parent 0a6c64445b
commit dde860f0b5
1 file changed
+3 -3
+3 -3
View File
@@ -132,10 +132,10 @@ def main():
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:
if not convert_to_bool(os.environ.get('DEBUG', '')):
os.environ['DEBUG'] = str(args.debug)
if convert_to_bool(os.environ['APPEND']) not True:
os.environ['DEBUG'] = str(args.append)
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()