Skip to content

Commit

Permalink
Merge pull request #2881 from locustio/ensure-we-dont-accidentally-hi…
Browse files Browse the repository at this point in the history
…de-errors-inside-locust-plugins-or-locust-cloud

Ensure we don't accidentally hide errors while importing in locust-cloud or locust-plugins
  • Loading branch information
cyberw authored Aug 30, 2024
2 parents 8e98d84 + 3b069d8 commit 9f03f6b
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 9f03f6b

Please sign in to comment.