fix(utils): coerce explicit status timeouts through float()

This commit is contained in:
wyzula_j committed 2026-09-01 17:29:40 +02:00
1 parent 00c14b28be
commit ff7e023c3a
1 file changed
+6
@@ -252,6 +252,12 @@ def _resolve_timeout(timeout, obj) -> float | None:
if timeout is NO_TIMEOUT:
return None
if timeout is not None:
try:
timeout = float(timeout)
except (TypeError, ValueError) as exc:
raise TypeError(
f"Status timeout must be a number, None or NO_TIMEOUT, got {timeout!r}"
) from exc
if not math.isfinite(timeout) or timeout <= 0:
return None
return timeout