home · contact · privacy
Fix stumbling over banned .__setattr__ in ClientDb's own methods.
authorChristian Heller <c.heller@plomlompom.de>
Thu, 14 Aug 2025 16:36:30 +0000 (18:36 +0200)
committerChristian Heller <c.heller@plomlompom.de>
Thu, 14 Aug 2025 16:36:30 +0000 (18:36 +0200)
ircplom/client.py

index 1cd66acda65714c4603c2f270eaac6b88855065a..dde587230efd5d46cb219a05dab029fc88b9aecf 100644 (file)
@@ -175,7 +175,7 @@ class IrcConnSetup(NamedTuple):
 
 
 class ClientDbBase:
-    'Optimized for dealing with variable confirmation of values.'
+    'For values of variable confirmation, and reading in multi-line lists.'
     client_host: str
     isupports: list[str]
     motd: list[str]
@@ -192,8 +192,12 @@ class ClientDbBase:
             return value
         return None
 
-    def __setattr__(self, key: str, value) -> None:
-        raise CrashingException('no direct attribute setting, use .set() etc.')
+    def __setattr__(self, key: str, *args, **kwargs) -> None:
+        if key[:1] == '_':
+            super().__setattr__(key, *args, **kwargs)
+        else:
+            raise CrashingException(
+                    'no direct attribute setting, use .set() etc.')
 
     @classmethod
     def _type_for(cls, key):