summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortoofar <toofar@spalge.com>2022-09-11 12:26:39 +1200
committertoofar <toofar@spalge.com>2022-09-11 17:22:50 +1200
commitb64fdfc5842f9be9637887aff38b313a600e7bed (patch)
tree0825c56c5653190924e0afa62145c67c28e90831
parent1bbf75ae7dbbfa2568bd5fe50dc1d7d213377f4e (diff)
downloadqutebrowser-b64fdfc5842f9be9637887aff38b313a600e7bed.tar.gz
qutebrowser-b64fdfc5842f9be9637887aff38b313a600e7bed.zip
mypy: ignore enum argument type: UrlFormattingOption
The docs say: > The options from QUrl::ComponentFormattingOptions are also possible. > The FormattingOptions type is a typedef for QFlags<UrlFormattingOption>. It stores an OR combination of UrlFormattingOption values. Maybe we should be should be definining out own types for some of the enums that include both the QFlag, enum and any child enums.
-rw-r--r--qutebrowser/browser/browsertab.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/qutebrowser/browser/browsertab.py b/qutebrowser/browser/browsertab.py
index 29eb06e55..9c6c52e0e 100644
--- a/qutebrowser/browser/browsertab.py
+++ b/qutebrowser/browser/browsertab.py
@@ -1322,7 +1322,8 @@ class AbstractTab(QWidget):
def __repr__(self) -> str:
try:
qurl = self.url()
- url = qurl.toDisplayString(QUrl.ComponentFormattingOption.EncodeUnicode)
+ as_unicode = QUrl.ComponentFormattingOption.EncodeUnicode
+ url = qurl.toDisplayString(as_unicode) # type: ignore[arg-type]
except (AttributeError, RuntimeError) as exc:
url = '<{}>'.format(exc.__class__.__name__)
else: