summaryrefslogtreecommitdiff
path: root/qutebrowser/qt/sip.py
blob: e24ad4826af316f2d7e23854cbee2fea9393908e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# FIXME:qt6 (lint)
# pylint: disable=missing-module-docstring,wildcard-import,unused-wildcard-import
# flake8: noqa

from qutebrowser.qt import machinery

# While upstream recommends using PyQt6.sip ever since PyQt6 5.11, some distributions
# still package later versions of PyQt6 with a top-level "sip" rather than "PyQt6.sip".

if machinery.USE_PYQT5:
    try:
        from PyQt5.sip import *
    except ImportError:
        from sip import *
elif machinery.USE_PYQT6:
    try:
        from PyQt6.sip import *
    except ImportError:
        from sip import *  # type: ignore[import]
elif machinery.USE_PYSIDE2:
    raise machinery.Unavailable()
elif machinery.USE_PYSIDE6:
    raise machinery.Unavailable()
else:
    raise machinery.UnknownWrapper()