Skip to content

Align bus.recv(timeout=n) method to raise an exception rather than return None when the timeout period is exceeded. #871

@Giraffe-Technology

Description

@Giraffe-Technology

Returning None when the timeout period has been exceeded seems to be inconsistent with other python methods that accept timeout parameters:-

I propose that a TimeoutError is raised instead of returning None:
*** Python Docs - https://docs.python.org/3/library/exceptions.html#TimeoutError
exception TimeoutError
Raised when a system function timed out at the system level. Corresponds to errno ETIMEDOUT


This would not be backwards compatible, but could be worked around by adding an instance attribute 'raise_timeout_exceptions' that defaults to False and so returns None or may be set to True in which case an exception is raised.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions