Skip to content

Commit 1e7597b

Browse files
authored
Fix float("inf") timeouts (#846)
* Fix float timeouts in synchronous event * Changelog
1 parent 9c818e9 commit 1e7597b

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
44

55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
66

7+
## Unreleased
8+
9+
- Fix `float("inf")` timeouts in `Event.wait` function. (#846)
10+
711
## 1.0.1 (November 3rd, 2023)
812

913
- Fix pool timeout to account for the total time spent retrying. (#823)

httpcore/_synchronization.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,8 @@ def set(self) -> None:
226226
self._event.set()
227227

228228
def wait(self, timeout: Optional[float] = None) -> None:
229+
if timeout == float("inf"): # pragma: no cover
230+
timeout = None
229231
if not self._event.wait(timeout=timeout):
230232
raise PoolTimeout() # pragma: nocover
231233

0 commit comments

Comments
 (0)