浏览代码

minor changes

Toan Quach 9 月之前
父节点
当前提交
6124670b0d
共有 1 个文件被更改,包括 2 次插入5 次删除
  1. 2 5
      taipy/core/data/data_node.py

+ 2 - 5
taipy/core/data/data_node.py

@@ -354,12 +354,9 @@ class DataNode(_Entity, _Labeled):
             return super().__setattr__(name, value)
         else:
             protected_attribute_name = _validate_id(name)
-            try:
-                if protected_attribute_name not in self._properties:
-                    raise AttributeError
+            if protected_attribute_name in self._properties:
                 raise AttributeKeyAlreadyExisted(name)
-            except AttributeError:
-                return super().__setattr__(name, value)
+            return super().__setattr__(name, value)
 
     def _get_attributes(self, protected_attribute_name, attribute_name):
         raise AttributeError