aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2/shibokenmodule/files.dir/shibokensupport/signature/parser.py
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2020-05-26 07:40:56 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2020-05-26 07:41:36 +0200
commit49c4d1f31014605c9355b1f6901e28e5762301d1 (patch)
tree8293343bf138ef2d53ab118b667fe1205d2b0bd7 /sources/shiboken2/shibokenmodule/files.dir/shibokensupport/signature/parser.py
parent10390cc16084c5f386163664f6e42d9e4d28b129 (diff)
parent6717d3540fac74c91d9381958a08e60f6532d402 (diff)
Merge remote-tracking branch 'origin/5.14' into 5.15
Diffstat (limited to 'sources/shiboken2/shibokenmodule/files.dir/shibokensupport/signature/parser.py')
-rw-r--r--sources/shiboken2/shibokenmodule/files.dir/shibokensupport/signature/parser.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/sources/shiboken2/shibokenmodule/files.dir/shibokensupport/signature/parser.py b/sources/shiboken2/shibokenmodule/files.dir/shibokensupport/signature/parser.py
index 8d970956b..2053c3e9d 100644
--- a/sources/shiboken2/shibokenmodule/files.dir/shibokensupport/signature/parser.py
+++ b/sources/shiboken2/shibokenmodule/files.dir/shibokensupport/signature/parser.py
@@ -165,6 +165,11 @@ def try_to_guess(thing, valtype):
return ret
return None
+def get_name(thing):
+ if isinstance(thing, type):
+ return getattr(thing, "__qualname__", thing.__name__)
+ else:
+ return thing.__name__
def _resolve_value(thing, valtype, line):
if thing in ("0", "None") and valtype:
@@ -172,7 +177,7 @@ def _resolve_value(thing, valtype, line):
return None
map = type_map[valtype]
# typing.Any: '_SpecialForm' object has no attribute '__name__'
- name = map.__name__ if hasattr(map, "__name__") else str(map)
+ name = get_name(map) if hasattr(map, "__name__") else str(map)
thing = "zero({})".format(name)
if thing in type_map:
return type_map[thing]
@@ -212,7 +217,8 @@ def to_string(thing):
return thing
if hasattr(thing, "__name__"):
dot = "." in str(thing)
- return thing.__module__ + "." + thing.__name__ if dot else thing.__name__
+ name = get_name(thing)
+ return thing.__module__ + "." + name if dot else name
# Note: This captures things from the typing module:
return str(thing)