From df6c13e395e3cff0653d073b1ad51d13b21faac7 Mon Sep 17 00:00:00 2001 From: laffra Date: Fri, 9 Feb 2024 11:59:07 +0100 Subject: [PATCH] Raise python exception to more clearly see MicroPython errorr --- ltk/widgets.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ltk/widgets.py b/ltk/widgets.py index 6afbf12..b72cb1f 100644 --- a/ltk/widgets.py +++ b/ltk/widgets.py @@ -326,7 +326,10 @@ def animate(self, properties, duration=None, easing=None, complete=None): def __getattr__(self, name): if not name in self.names: self.names.add(name) - return getattr(self.element, name) + try: + return getattr(self.element, name) + except: + raise AttributeError(f"LTK widget {self} does not have attribute {name}") def toJSON(self, *args): return f"[{self.__class__.__name__}|{','.join(args)}]"