From 636bb07d1f30eda86bec0a57d07686ed3c954c50 Mon Sep 17 00:00:00 2001 From: FiveYellowMice Date: Mon, 16 Oct 2023 00:44:20 +1100 Subject: [PATCH] NamedInt: return False on comparison with None --- lib/logitech_receiver/common.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/logitech_receiver/common.py b/lib/logitech_receiver/common.py index b2d871fa..3be447b1 100644 --- a/lib/logitech_receiver/common.py +++ b/lib/logitech_receiver/common.py @@ -44,6 +44,8 @@ class NamedInt(int): return int2bytes(self, count) def __eq__(self, other): + if other is None: + return False if isinstance(other, NamedInt): return int(self) == int(other) and self.name == other.name if isinstance(other, int):