summaryrefslogtreecommitdiff
path: root/qutebrowser/utils/qtutils.py
diff options
context:
space:
mode:
Diffstat (limited to 'qutebrowser/utils/qtutils.py')
-rw-r--r--qutebrowser/utils/qtutils.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/qutebrowser/utils/qtutils.py b/qutebrowser/utils/qtutils.py
index 0bd9c94e8..87f74425e 100644
--- a/qutebrowser/utils/qtutils.py
+++ b/qutebrowser/utils/qtutils.py
@@ -455,6 +455,12 @@ class QtValueError(ValueError):
super().__init__(err)
+if machinery.IS_QT6:
+ _ProcessEventFlagType = QEventLoop.ProcessEventsFlag
+else:
+ _ProcessEventFlagType = QEventLoop.ProcessEventsFlags
+
+
class EventLoop(QEventLoop):
"""A thin wrapper around QEventLoop.
@@ -468,8 +474,9 @@ class EventLoop(QEventLoop):
def exec(
self,
- flags: QEventLoop.ProcessEventsFlag =
- QEventLoop.ProcessEventsFlag.AllEvents
+ flags: _ProcessEventFlagType = (
+ QEventLoop.ProcessEventsFlag.AllEvents # type: ignore[assignment]
+ ),
) -> int:
"""Override exec_ to raise an exception when re-running."""
if self._executing: