handle exeptions when dict is empty

This commit is contained in:
Jaikinator
2024-01-26 15:38:53 +01:00
parent b0858e4647
commit c1ed0547b8
+8 -1
View File
@@ -172,7 +172,14 @@ def cli():
config = arg_dict.pop("server_config")
server_kwargs = arg_dict.pop("server_kwargs")
subprocess.run([sys.executable, execute_path, f"--server-config={config}", f"--server-kwargs={server_kwargs}"])
if not config:
subprocess.run([sys.executable, execute_path, f"--server-kwargs={server_kwargs}"])
elif not server_kwargs:
subprocess.run([sys.executable, execute_path, f"--server-config={config}"])
elif not config and not server_kwargs:
subprocess.run([sys.executable, execute_path])
else:
subprocess.run([sys.executable, execute_path, f"--server-config={config}", f"--server-kwargs={server_kwargs}"])
if __name__ == "__main__":
cli()