From 8a45328741ee2b02d495c29c7fa74f60a4df8017 Mon Sep 17 00:00:00 2001 From: Eugene Triguba Date: Sun, 20 Dec 2020 11:38:16 -0600 Subject: Change `Client` to raise a TypeError instead of a ValueError --- CHANGELOG.rst | 5 +++++ lirc/client.py | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 17b138b..0977d0d 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -10,6 +10,11 @@ adheres to `Semantic Versioning `_. Unreleased ------------------ +**Changed** + +- ``lirc.Client`` raises a ``TypeError`` instead of a ``ValueError`` now + if a ``connection`` is passed in that is not an instance of ``LircdConnection``. + **Removed** - ``socket`` property from ``LircdConnection``. diff --git a/lirc/client.py b/lirc/client.py index 0a1b7b1..0e3fa80 100644 --- a/lirc/client.py +++ b/lirc/client.py @@ -18,14 +18,14 @@ class Client: depending on the operating system if one is not provided. Raises: - ValueError: If connection is not an instance of LircdConnection. + TypeError: If connection is not an instance of LircdConnection. LircdConnectionError: If the socket cannot connect to the address. """ if not connection: connection = LircdConnection() if not isinstance(connection, LircdConnection): - raise ValueError("`connection` must be an instance of `LircdConnection`") + raise TypeError("`connection` must be an instance of `LircdConnection`") # Used for start_repeat and stop_repeat self.__last_send_start_remote = None -- cgit v1.2.3