Skip to content

Commit

Permalink
Dont crash if parsed_options is missing tags/exclude_tags attributes.…
Browse files Browse the repository at this point in the history
… Replaces PR #2660
  • Loading branch information
cyberw committed May 2, 2024
1 parent 34b0b81 commit 9417953
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions locust/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,14 +222,14 @@ def _filter_tasks_by_tags(self) -> None:

if self.tags is not None:
tags = set(self.tags)
elif self.parsed_options and self.parsed_options.tags:
elif self.parsed_options and getattr(self.parsed_options, "tags", False):
tags = set(self.parsed_options.tags)
else:
tags = None

if self.exclude_tags is not None:
exclude_tags = set(self.exclude_tags)
elif self.parsed_options and self.parsed_options.exclude_tags:
elif self.parsed_options and getattr(self.parsed_options, "exclude_tags", False):
exclude_tags = set(self.parsed_options.exclude_tags)
else:
exclude_tags = None
Expand Down

0 comments on commit 9417953

Please sign in to comment.