summaryrefslogtreecommitdiff
path: root/qutebrowser
diff options
context:
space:
mode:
authortoofar <toofar@spalge.com>2024-04-28 12:40:42 +1200
committertoofar <toofar@spalge.com>2024-04-28 12:43:40 +1200
commitbdbbb93cd2120d8d58108da2b5fe72d65bff19f7 (patch)
tree6f08b993fc1a432fa761c2d1d3f92d1d1167c5b4 /qutebrowser
parent085af130140bc4c7fadd60de611f4c3e4ea5ee0f (diff)
downloadqutebrowser-bdbbb93cd2120d8d58108da2b5fe72d65bff19f7.tar.gz
qutebrowser-bdbbb93cd2120d8d58108da2b5fe72d65bff19f7.zip
fix lint, add cheroot log ignores
mypy: Mypy knows about the QDataStream.Status.SizeLimitExceeded attribute now, so we can remove the ignore. But mypy for pyqt5 doesn't know about it, so put the whole graceful block behind an additional conditional as well to hide it from pyqt5 mypy. cheroot: looks like the format of the error message we are already ignoring changed slightly. The `ssl/tls` bit changed to `sslv3`, at least in our setup.
Diffstat (limited to 'qutebrowser')
-rw-r--r--qutebrowser/utils/qtutils.py17
1 files changed, 9 insertions, 8 deletions
diff --git a/qutebrowser/utils/qtutils.py b/qutebrowser/utils/qtutils.py
index 21f3b8478..c1f05b78d 100644
--- a/qutebrowser/utils/qtutils.py
+++ b/qutebrowser/utils/qtutils.py
@@ -193,14 +193,15 @@ def check_qdatastream(stream: QDataStream) -> None:
QDataStream.Status.WriteFailed: ("The data stream cannot write to the "
"underlying device."),
}
- try:
- status_to_str[QDataStream.Status.SizeLimitExceeded] = ( # type: ignore[attr-defined]
- "The data stream cannot read or write the data because its size is larger "
- "than supported by the current platform."
- )
- except AttributeError:
- # Added in Qt 6.7
- pass
+ if machinery.IS_QT6:
+ try:
+ status_to_str[QDataStream.Status.SizeLimitExceeded] = (
+ "The data stream cannot read or write the data because its size is larger "
+ "than supported by the current platform."
+ )
+ except AttributeError:
+ # Added in Qt 6.7
+ pass
if stream.status() != QDataStream.Status.Ok:
raise OSError(status_to_str[stream.status()])