From 8fb2414e8efabc92e982cde1df7371caa051c5e6 Mon Sep 17 00:00:00 2001 From: iabdalkader Date: Wed, 21 Sep 2022 16:58:10 +0200 Subject: [PATCH] ucloud: Fix set/get attr to work with MicroPython. --- arduino_iot_cloud/ucloud.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arduino_iot_cloud/ucloud.py b/arduino_iot_cloud/ucloud.py index 0a07041..7298480 100644 --- a/arduino_iot_cloud/ucloud.py +++ b/arduino_iot_cloud/ucloud.py @@ -113,12 +113,12 @@ def value(self, value): self._value = value def __getattr__(self, attr): - if isinstance(super().__dict__.get("_value", None), dict) and attr in super().value: + if isinstance(getattr(super(), "_value", None), dict) and attr in super().value: return super().value[attr].value raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{attr}'") def __setattr__(self, name, value): - if isinstance(super().__dict__.get("_value", None), dict) and name in super().value: + if isinstance(getattr(super(), "_value", None), dict) and name in super().value: self.value[name].value = value else: super().__setattr__(name, value)