From 3bf068e0b2b2b54a71af73c147ab75eea1d876f3 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Thu, 17 Aug 2023 01:35:39 +0200 Subject: [PATCH] The __main__ function should take no arguments. setup.py won't pass any arguments to `main()`, so the default entry point should get them itself from `sys.argv`. --- platypush/__main__.py | 4 +--- platypush/runner/__init__.py | 6 ++++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/platypush/__main__.py b/platypush/__main__.py index 737e265b75..fdd647fee4 100644 --- a/platypush/__main__.py +++ b/platypush/__main__.py @@ -1,5 +1,3 @@ -import sys - from platypush.runner import main -main(*sys.argv[1:]) +main() diff --git a/platypush/runner/__init__.py b/platypush/runner/__init__.py index e0c8269fde..1ea844698e 100644 --- a/platypush/runner/__init__.py +++ b/platypush/runner/__init__.py @@ -1,7 +1,9 @@ +import sys + from ._runner import ApplicationRunner -def main(*args: str): +def main(): """ Main application entry point. @@ -11,7 +13,7 @@ def main(*args: str): """ app_runner = ApplicationRunner() - app_runner.run(*args) + app_runner.run(*sys.argv[1:]) __all__ = ["ApplicationRunner", "main"]