aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken6/tests/shiboken_test_helper.py
blob: 2c7ad4d09a249cdfcff9e323cdf40bdb53370d78 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
from __future__ import annotations


def objectFullname(t):
    # '__qualname__' for Python 2 does exist for PySide types, only.
    name = getattr(t, "__qualname__", t.__name__)
    module = t.__module__
    if module is None or module == str.__class__.__module__:
        return name
    else:
        return module + '.' + name