From e76a063e63b95fbb850649b09beeb5ccdcc83c60 Mon Sep 17 00:00:00 2001 From: toofar Date: Sun, 11 Sep 2022 10:52:38 +1200 Subject: mypy: defer to machinery for conditional: QLibraryInfo --- qutebrowser/utils/qtutils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qutebrowser/utils/qtutils.py b/qutebrowser/utils/qtutils.py index 87f74425e..430f15c75 100644 --- a/qutebrowser/utils/qtutils.py +++ b/qutebrowser/utils/qtutils.py @@ -36,6 +36,7 @@ import contextlib from typing import (Any, AnyStr, TYPE_CHECKING, BinaryIO, IO, Iterator, Optional, Union, Tuple, cast) +from qutebrowser.qt import machinery from qutebrowser.qt.core import (qVersion, QEventLoop, QDataStream, QByteArray, QIODevice, QFileDevice, QSaveFile, QT_VERSION_STR, PYQT_VERSION_STR, QObject, QUrl, QLibraryInfo) @@ -588,8 +589,7 @@ class LibraryPath(enum.Enum): def library_path(which: LibraryPath) -> pathlib.Path: """Wrapper around QLibraryInfo.path / .location.""" - if hasattr(QLibraryInfo, "path"): - # Qt 6 + if machinery.IS_QT6: val = getattr(QLibraryInfo.LibraryPath, which.value) ret = QLibraryInfo.path(val) else: -- cgit v1.2.3-54-g00ecf