diff options
author | Florian Bruhin <me@the-compiler.org> | 2023-06-12 21:41:25 +0200 |
---|---|---|
committer | Florian Bruhin <me@the-compiler.org> | 2023-06-12 21:42:16 +0200 |
commit | 89322cd9add66a6a7da8c624a916c353dbfd9021 (patch) | |
tree | 82b743923808b51607955438b2d01a71010b5147 | |
parent | eaf71c8e410219c65b8220ac26024f8abc41f1dd (diff) | |
download | qutebrowser-89322cd9add66a6a7da8c624a916c353dbfd9021.tar.gz qutebrowser-89322cd9add66a6a7da8c624a916c353dbfd9021.zip |
qt: Remove duplicate machine.PACKAGE
Contains the exact same string we have in .WRAPPER already anyways.
-rw-r--r-- | qutebrowser/misc/earlyinit.py | 4 | ||||
-rw-r--r-- | qutebrowser/qt/machinery.py | 12 |
2 files changed, 3 insertions, 13 deletions
diff --git a/qutebrowser/misc/earlyinit.py b/qutebrowser/misc/earlyinit.py index ef7814ab1..288d42f77 100644 --- a/qutebrowser/misc/earlyinit.py +++ b/qutebrowser/misc/earlyinit.py @@ -140,7 +140,7 @@ def check_pyqt(): """Check if PyQt core modules (QtCore/QtWidgets) are installed.""" from qutebrowser.qt import machinery - packages = [f'{machinery.PACKAGE}.QtCore', f'{machinery.PACKAGE}.QtWidgets'] + packages = [f'{machinery.WRAPPER}.QtCore', f'{machinery.WRAPPER}.QtWidgets'] for name in packages: try: importlib.import_module(name) @@ -247,7 +247,7 @@ def check_libraries(): } for subpkg in ['QtQml', 'QtOpenGL', 'QtDBus']: - package = f'{machinery.PACKAGE}.{subpkg}' + package = f'{machinery.WRAPPER}.{subpkg}' modules[package] = _missing_str(package) if sys.version_info < (3, 9): diff --git a/qutebrowser/qt/machinery.py b/qutebrowser/qt/machinery.py index 71e1c832c..a9b88c121 100644 --- a/qutebrowser/qt/machinery.py +++ b/qutebrowser/qt/machinery.py @@ -116,9 +116,6 @@ IS_PYQT: bool #: Whether we are using any PySide wrapper. IS_PYSIDE: bool -#: The name of the package imported. -PACKAGE: str - _initialized = False @@ -139,7 +136,7 @@ def init(args: Union[argparse.Namespace, None] = None) -> None: In this case, `args` will be None. """ global WRAPPER, USE_PYQT5, USE_PYQT6, USE_PYSIDE6, IS_QT5, IS_QT6, \ - IS_PYQT, IS_PYSIDE, PACKAGE, _initialized + IS_PYQT, IS_PYSIDE, _initialized if args is None: # Implicit initialization can happen multiple times @@ -168,10 +165,3 @@ def init(args: Union[argparse.Namespace, None] = None) -> None: IS_PYSIDE = USE_PYSIDE6 assert IS_QT5 ^ IS_QT6 assert IS_PYQT ^ IS_PYSIDE - - if USE_PYQT5: - PACKAGE = "PyQt5" - elif USE_PYQT6: - PACKAGE = "PyQt6" - elif USE_PYSIDE6: - PACKAGE = "PySide6" |