Skip to content

Commit

Permalink
Fix the float type conversion in the timeout_check (sherlock-project#…
Browse files Browse the repository at this point in the history
  • Loading branch information
matheusfelipeog committed Dec 25, 2023
2 parents 4525fb4 + 409d15c commit 2813b91
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions sherlock/sherlock.py
Original file line number Diff line number Diff line change
Expand Up @@ -470,12 +470,14 @@ def timeout_check(value):
NOTE: Will raise an exception if the timeout in invalid.
"""

if value <= 0:
float_value = float(value)

if float_value <= 0:
raise ArgumentTypeError(
f"Invalid timeout value: {value}. Timeout must be a positive number."
)

return float(value)
return float_value


def handler(signal_received, frame):
Expand Down

0 comments on commit 2813b91

Please sign in to comment.