diff options
author | toofar <toofar@spalge.com> | 2024-04-28 12:40:42 +1200 |
---|---|---|
committer | toofar <toofar@spalge.com> | 2024-04-28 12:43:40 +1200 |
commit | bdbbb93cd2120d8d58108da2b5fe72d65bff19f7 (patch) | |
tree | 6f08b993fc1a432fa761c2d1d3f92d1d1167c5b4 | |
parent | 085af130140bc4c7fadd60de611f4c3e4ea5ee0f (diff) | |
download | qutebrowser-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.
-rw-r--r-- | qutebrowser/utils/qtutils.py | 17 | ||||
-rw-r--r-- | tests/end2end/fixtures/webserver.py | 2 |
2 files changed, 10 insertions, 9 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()]) diff --git a/tests/end2end/fixtures/webserver.py b/tests/end2end/fixtures/webserver.py index 924cb520b..b70401745 100644 --- a/tests/end2end/fixtures/webserver.py +++ b/tests/end2end/fixtures/webserver.py @@ -116,7 +116,7 @@ def is_ignored_webserver_message(line: str) -> bool: return testutils.pattern_match( pattern=( "Client ('127.0.0.1', *) lost — peer dropped the TLS connection suddenly, " - "during handshake: (1, '[SSL: SSLV3_ALERT_CERTIFICATE_UNKNOWN] ssl/tls " + "during handshake: (1, '[SSL: SSLV3_ALERT_CERTIFICATE_UNKNOWN] * " "alert certificate unknown (_ssl.c:*)')" ), value=line, |