Skip to content

Commit 9a7568a

Browse files
committed
ConcurrentRunner.join timeout defaults to None, not 0
1 parent 8c5dbc3 commit 9a7568a

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

test/asynchronous/helpers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
except ImportError:
4141
HAVE_IPADDRESS = False
4242
from functools import wraps
43-
from typing import Any, Callable, Dict, Generator, no_type_check
43+
from typing import Any, Callable, Dict, Generator, Optional, no_type_check
4444
from unittest import SkipTest
4545

4646
from bson.son import SON
@@ -395,7 +395,7 @@ def __init__(self, **kwargs):
395395
async def start(self):
396396
self.task = create_task(self.run(), name=self.name)
397397

398-
async def join(self, timeout: float | None = 0): # type: ignore[override]
398+
async def join(self, timeout: Optional[float] = None): # type: ignore[override]
399399
if self.task is not None:
400400
await asyncio.wait([self.task], timeout=timeout)
401401

test/asynchronous/test_load_balancer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ async def lock_pool(self):
186186

187187
async def wait(self, event: Event, timeout: int):
188188
if _IS_SYNC:
189-
return event.wait(timeout)
189+
return event.wait(timeout) # type: ignore[call-arg]
190190
else:
191191
try:
192192
await asyncio.wait_for(event.wait(), timeout=timeout)

test/helpers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
except ImportError:
4141
HAVE_IPADDRESS = False
4242
from functools import wraps
43-
from typing import Any, Callable, Dict, Generator, no_type_check
43+
from typing import Any, Callable, Dict, Generator, Optional, no_type_check
4444
from unittest import SkipTest
4545

4646
from bson.son import SON
@@ -395,7 +395,7 @@ def __init__(self, **kwargs):
395395
def start(self):
396396
self.task = create_task(self.run(), name=self.name)
397397

398-
def join(self, timeout: float | None = 0): # type: ignore[override]
398+
def join(self, timeout: Optional[float] = None): # type: ignore[override]
399399
if self.task is not None:
400400
asyncio.wait([self.task], timeout=timeout)
401401

test/test_load_balancer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ def lock_pool(self):
186186

187187
def wait(self, event: Event, timeout: int):
188188
if _IS_SYNC:
189-
return event.wait(timeout)
189+
return event.wait(timeout) # type: ignore[call-arg]
190190
else:
191191
try:
192192
asyncio.wait_for(event.wait(), timeout=timeout)

0 commit comments

Comments
 (0)