From 9c508154c41b29e0bc028a795aa817bd5bb65f27 Mon Sep 17 00:00:00 2001 From: Nick Moore Date: Fri, 30 Aug 2024 15:44:34 +1000 Subject: [PATCH] Fix 3.9 compatibility --- countess/core/parameters.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/countess/core/parameters.py b/countess/core/parameters.py index 7302fb7..3f515c2 100644 --- a/countess/core/parameters.py +++ b/countess/core/parameters.py @@ -888,7 +888,11 @@ def __getattr__(self, name): try: return self.params[name] except KeyError as exc: - raise AttributeError(name=name, obj=self) from exc + try: + raise AttributeError(name=name, obj=self) from exc + except TypeError: # pragma: no cover + # 3.9 doesn't have name and obj attributes + raise AttributeError() from exc def __setattr__(self, name, value): """Intercepts attempts to set parameters to a value and turns them into parameter.set_value.