Return the remaining timeout clamped to a max value.
(max_timeout: float)
| 61 | |
| 62 | |
| 63 | def clamp_remaining(max_timeout: float) -> float: |
| 64 | """Return the remaining timeout clamped to a max value.""" |
| 65 | timeout = remaining() |
| 66 | if timeout is None: |
| 67 | return max_timeout |
| 68 | return min(timeout, max_timeout) |
| 69 | |
| 70 | |
| 71 | class _TimeoutContext(AbstractContextManager[Any]): |
nothing calls this directly
no test coverage detected