diff options
author | toofar <toofar@spalge.com> | 2022-09-11 11:34:41 +1200 |
---|---|---|
committer | toofar <toofar@spalge.com> | 2022-09-11 17:22:50 +1200 |
commit | fda08527f1d4d02666cc8d76040286fb69c1ac82 (patch) | |
tree | 53319e12ce565860dab7668ef7e7c54ec7119f3f | |
parent | 647b74197a779e00cae1847654796581df28a7b0 (diff) | |
download | qutebrowser-fda08527f1d4d02666cc8d76040286fb69c1ac82.tar.gz qutebrowser-fda08527f1d4d02666cc8d76040286fb69c1ac82.zip |
mypy: defer to machinery for conditional: QVariant
-rw-r--r-- | qutebrowser/browser/webengine/notification.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/qutebrowser/browser/webengine/notification.py b/qutebrowser/browser/webengine/notification.py index 7e7e53497..d7f797274 100644 --- a/qutebrowser/browser/webengine/notification.py +++ b/qutebrowser/browser/webengine/notification.py @@ -50,6 +50,7 @@ import functools import subprocess from typing import Any, List, Dict, Optional, Iterator, Type, TYPE_CHECKING +from qutebrowser.qt import machinery from qutebrowser.qt.core import (Qt, QObject, QVariant, QMetaType, QByteArray, pyqtSlot, pyqtSignal, QTimer, QProcess, QUrl) from qutebrowser.qt.gui import QImage, QIcon, QPixmap @@ -686,10 +687,9 @@ def _as_uint32(x: int) -> QVariant: """Convert the given int to an uint32 for DBus.""" variant = QVariant(x) - try: - # Qt 5 + if machinery.IS_QT5: target_type = QVariant.Type.UInt - except AttributeError: + else: # Qt 6 target_type = QMetaType(QMetaType.Type.UInt.value) |