Skip to content

Commit

Permalink
Ensure we don't accidentally hide errors while importing in locust-cl…
Browse files Browse the repository at this point in the history
…oud or locust-plugins
  • Loading branch information
cyberw committed Aug 30, 2024
1 parent 8e98d84 commit 3b069d8
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions locust/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__

Expand Down

0 comments on commit 3b069d8

Please sign in to comment.