summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEugene Triguba <eugenetriguba@gmail.com>2020-12-20 11:38:16 -0600
committerEugene Triguba <eugenetriguba@gmail.com>2020-12-20 11:38:16 -0600
commit8a45328741ee2b02d495c29c7fa74f60a4df8017 (patch)
tree5e1ba283efd4830c8b1209dfb65ab67fa81a276a
parentAdd platform badge (diff)
downloadlirc-8a45328741ee2b02d495c29c7fa74f60a4df8017.zip
Change `Client` to raise a TypeError instead of a ValueError
-rw-r--r--CHANGELOG.rst5
-rw-r--r--lirc/client.py4
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 <https://semver.org/spec/v2.0.0.html>`_.
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