aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside-tools/metaobjectdump.py
diff options
context:
space:
mode:
Diffstat (limited to 'sources/pyside-tools/metaobjectdump.py')
-rw-r--r--sources/pyside-tools/metaobjectdump.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/sources/pyside-tools/metaobjectdump.py b/sources/pyside-tools/metaobjectdump.py
index d14c3334a..f3c0c5606 100644
--- a/sources/pyside-tools/metaobjectdump.py
+++ b/sources/pyside-tools/metaobjectdump.py
@@ -70,9 +70,11 @@ def _attribute(node: ast.Attribute) -> tuple[str, str]:
return node.value.id, node.attr
-def _name(node: ast.Name | ast.Attribute) -> str:
+def _name(node: ast.Name | ast.Attribute | ast.Constant) -> str:
"""Return the name of something that is either an attribute or a name,
such as base classes or call.func"""
+ if isinstance(node, ast.Constant):
+ return str(node.value)
if isinstance(node, ast.Attribute):
qualifier, name = _attribute(node)
return f"{qualifier}.{node.attr}"