diff --git a/locust/main.py b/locust/main.py index b742b12356..4031f2bb3b 100644 --- a/locust/main.py +++ b/locust/main.py @@ -39,12 +39,14 @@ # import external plugins if installed to allow for registering custom arguments etc try: import locust_plugins # pyright: ignore[reportMissingImports] -except ModuleNotFoundError: - pass +except ModuleNotFoundError as e: + if e.msg != "No module named 'locust_plugins'": + raise try: import locust_cloud # pyright: ignore[reportMissingImports] -except ModuleNotFoundError: - pass +except ModuleNotFoundError as e: + if e.msg != "No module named 'locust_cloud'": + raise version = locust.__version__