From 518d15c3d1a3ae7d99725d559c21afab2c417b0f Mon Sep 17 00:00:00 2001 From: Christian Heller Date: Thu, 14 Aug 2025 18:36:30 +0200 Subject: [PATCH] Fix stumbling over banned .__setattr__ in ClientDb's own methods. --- ircplom/client.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/ircplom/client.py b/ircplom/client.py index 1cd66ac..dde5872 100644 --- a/ircplom/client.py +++ b/ircplom/client.py @@ -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): -- 2.30.2