diff options
Diffstat (limited to 'sources/shiboken2/shibokenmodule/files.dir/shibokensupport/signature')
4 files changed, 19 insertions, 11 deletions
diff --git a/sources/shiboken2/shibokenmodule/files.dir/shibokensupport/signature/errorhandler.py b/sources/shiboken2/shibokenmodule/files.dir/shibokensupport/signature/errorhandler.py index 0403358bb..4dbed077d 100644 --- a/sources/shiboken2/shibokenmodule/files.dir/shibokensupport/signature/errorhandler.py +++ b/sources/shiboken2/shibokenmodule/files.dir/shibokensupport/signature/errorhandler.py @@ -1,6 +1,6 @@ ############################################################################# ## -## Copyright (C) 2019 The Qt Company Ltd. +## Copyright (C) 2020 The Qt Company Ltd. ## Contact: https://www.qt.io/licensing/ ## ## This file is part of Qt for Python. diff --git a/sources/shiboken2/shibokenmodule/files.dir/shibokensupport/signature/importhandler.py b/sources/shiboken2/shibokenmodule/files.dir/shibokensupport/signature/importhandler.py index 0417f132a..7af43bea0 100644 --- a/sources/shiboken2/shibokenmodule/files.dir/shibokensupport/signature/importhandler.py +++ b/sources/shiboken2/shibokenmodule/files.dir/shibokensupport/signature/importhandler.py @@ -70,7 +70,7 @@ def finish_import(module): if func: func(module) except Exception as e: - name = e.__class__.__name__ + name = e.__class__.__qualname__ print(72 * "*") print("Error in deprecated.py, ignored:") print(" {name}: {e}".format(**locals())) diff --git a/sources/shiboken2/shibokenmodule/files.dir/shibokensupport/signature/lib/enum_sig.py b/sources/shiboken2/shibokenmodule/files.dir/shibokensupport/signature/lib/enum_sig.py index f11f3cf3d..fa4d5e77c 100644 --- a/sources/shiboken2/shibokenmodule/files.dir/shibokensupport/signature/lib/enum_sig.py +++ b/sources/shiboken2/shibokenmodule/files.dir/shibokensupport/signature/lib/enum_sig.py @@ -1,6 +1,6 @@ ############################################################################# ## -## Copyright (C) 2018 The Qt Company Ltd. +## Copyright (C) 2020 The Qt Company Ltd. ## Contact: https://www.qt.io/licensing/ ## ## This file is part of Qt for Python. @@ -100,17 +100,19 @@ class ExactEnumerator(object): return ret def klass(self, class_name, klass): + ret = self.result_type() + if "<" in class_name: + # This is happening in QtQuick for some reason: + ## class QSharedPointer<QQuickItemGrabResult >: + # We simply skip over this class. + return ret bases_list = [] for base in klass.__bases__: name = base.__name__ - if name in ("object", "type"): - pass - else: - modname = base.__module__ - name = modname + "." + base.__name__ + if name not in ("object", "type"): + name = base.__module__ + "." + name bases_list.append(name) class_str = "{}({})".format(class_name, ", ".join(bases_list)) - ret = self.result_type() # class_members = inspect.getmembers(klass) # gives us also the inherited things. class_members = sorted(list(klass.__dict__.items())) 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) |