From 3298b19e1d822dd4095f3fd829c5f0f1f6874b55 Mon Sep 17 00:00:00 2001 From: Jon Dufresne Date: Sat, 19 Oct 2019 15:34:59 -0700 Subject: [PATCH] Add __main__.py file Allows executing locust as a module using the command: $ python -m locust https://docs.python.org/3/library/__main__.html --- locust/__main__.py | 3 +++ locust/main.py | 3 --- 2 files changed, 3 insertions(+), 3 deletions(-) create mode 100644 locust/__main__.py diff --git a/locust/__main__.py b/locust/__main__.py new file mode 100644 index 0000000000..5d6a8109e6 --- /dev/null +++ b/locust/__main__.py @@ -0,0 +1,3 @@ +from .main import main + +main() diff --git a/locust/main.py b/locust/main.py index f4a81d238c..7362c3c1ec 100644 --- a/locust/main.py +++ b/locust/main.py @@ -510,6 +510,3 @@ def sig_term_handler(): shutdown(code=code) except KeyboardInterrupt as e: shutdown(0) - -if __name__ == '__main__': - main()