mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-11 02:02:22 +00:00
PanelSpy - target not all callables
Because sometimes we have `Data` classes as panel attributes and they're also callable.
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
|
||||
from __future__ import annotations
|
||||
import os
|
||||
import types
|
||||
import bpy
|
||||
import pytest
|
||||
import traceback
|
||||
@@ -81,7 +82,8 @@ class PanelSpy:
|
||||
return self
|
||||
sentinel = object()
|
||||
attr_value = getattr(self.blender_panel, attr, sentinel)
|
||||
if attr_value is not sentinel and not callable(attr_value):
|
||||
# Don't use `callable`, because we might have `Data` classes as panel attributes.
|
||||
if attr_value is not sentinel and not isinstance(attr_value, types.FunctionType):
|
||||
return attr_value
|
||||
return self
|
||||
|
||||
|
||||
Reference in New Issue
Block a user