summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortoofar <toofar@spalge.com>2022-09-11 10:52:38 +1200
committertoofar <toofar@spalge.com>2022-09-11 17:22:50 +1200
commite76a063e63b95fbb850649b09beeb5ccdcc83c60 (patch)
treee7bbc780887c7c4907071883eb230e659fe55c75
parent56822836c5568ce6d5238e3b579770ebb8846b13 (diff)
downloadqutebrowser-e76a063e63b95fbb850649b09beeb5ccdcc83c60.tar.gz
qutebrowser-e76a063e63b95fbb850649b09beeb5ccdcc83c60.zip
mypy: defer to machinery for conditional: QLibraryInfo
-rw-r--r--qutebrowser/utils/qtutils.py4
1 files 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: