Skip to content

Commit

Permalink
Removed line with variable reassignment
Browse files Browse the repository at this point in the history
  • Loading branch information
Piotr Sawicki committed Apr 22, 2024
1 parent 30386e6 commit 9faddd6
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions locust/util/timespan.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ def parse_timespan(time_str) -> int:
parts = timespan_regex.match(time_str)
if not parts:
raise ValueError("Invalid time span format. Valid formats: 20, 20s, 3m, 2h, 1h20m, 3h30m10s, etc.")
parts = parts.groupdict()
time_params = {name: int(value) for name, value in parts.items() if value}
time_params = {name: int(value) for name, value in parts.groupdict().items() if value}
if not time_params:
raise ValueError("Invalid time span format. Valid formats: 20, 20s, 3m, 2h, 1h20m, 3h30m10s, etc.")
return int(timedelta(**time_params).total_seconds())

0 comments on commit 9faddd6

Please sign in to comment.