diff --git a/can/interfaces/cantact.py b/can/interfaces/cantact.py index ee01fbf94..26b4102c0 100644 --- a/can/interfaces/cantact.py +++ b/can/interfaces/cantact.py @@ -125,9 +125,7 @@ def __init__( def _recv_internal(self, timeout: float | None) -> tuple[Message | None, bool]: if timeout is None: - raise TypeError( - f"{self.__class__.__name__} expects a numeric `timeout` value." - ) + timeout = 2**64 - 1 with error_check("Cannot receive message"): frame = self.interface.recv(int(timeout * 1000)) diff --git a/doc/changelog.d/2026.changed.md b/doc/changelog.d/2026.changed.md new file mode 100644 index 000000000..2a9c12fa1 --- /dev/null +++ b/doc/changelog.d/2026.changed.md @@ -0,0 +1 @@ +* cantact: handle None timeouts as 'forever' (with 0xFFF....)