mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-19 11:43:53 +00:00
More python 3.14 fixes, see 9bac66a
This commit is contained in:
@@ -96,7 +96,11 @@ class PanelSpy:
|
||||
|
||||
def __getattr__(self, attr: str) -> PanelSpy | Any:
|
||||
self.spied_attr = attr
|
||||
if annotation := self.blender_panel.__annotations__.get(attr, None):
|
||||
try:
|
||||
annotations = self.blender_panel.__annotations__
|
||||
except AttributeError:
|
||||
annotations = type(self.blender_panel).__annotations__
|
||||
if annotation := annotations.get(attr, None):
|
||||
return annotation.keywords.get("default", None) # An operator property
|
||||
if attr == "layout":
|
||||
return self
|
||||
@@ -136,7 +140,11 @@ class PanelSpy:
|
||||
prop_type = props.bl_rna.properties[name].type
|
||||
enum_items = []
|
||||
if prop_type == "ENUM":
|
||||
prop_keywords = props.__annotations__[name].keywords
|
||||
try:
|
||||
annotations = props.__annotations__
|
||||
except AttributeError:
|
||||
annotations = type(props).__annotations__
|
||||
prop_keywords = annotations[name].keywords
|
||||
items = prop_keywords.get("items")
|
||||
if items is not None:
|
||||
if isinstance(items, (list, tuple)):
|
||||
|
||||
Reference in New Issue
Block a user