From ffbb1862d5bfde080ef22cf932cd8add58f98ff3 Mon Sep 17 00:00:00 2001 From: Aymeric Augustin Date: Thu, 11 Nov 2021 19:14:09 +0100 Subject: [PATCH 1/3] Unpin Python 3.9.6. Reverts 744482a2. Fix #1051. --- .github/workflows/tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d8a95a70d..3aa579aa4 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -18,7 +18,7 @@ jobs: - name: Install Python 3.x uses: actions/setup-python@v2 with: - python-version: "3.9.6" + python-version: "3.x" - name: Install tox run: pip install tox - name: Run tests with coverage @@ -38,7 +38,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python: ["3.7", "3.8", "3.9.6", "3.10"] + python: ["3.7", "3.8", "3.9", "3.10"] steps: - name: Check out repository uses: actions/checkout@v2 From 02a04e2bc3471474d179685719a8f100d6137c23 Mon Sep 17 00:00:00 2001 From: Aymeric Augustin Date: Thu, 11 Nov 2021 19:31:33 +0100 Subject: [PATCH 2/3] Work around bug in coverage. --- tests/legacy/test_client_server.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/legacy/test_client_server.py b/tests/legacy/test_client_server.py index fea2b4178..4eb8229b2 100644 --- a/tests/legacy/test_client_server.py +++ b/tests/legacy/test_client_server.py @@ -1454,6 +1454,7 @@ async def run_client(): await server_ws.close() with self.assertRaises(ConnectionClosed): await ws.recv() + pass # work around bug in coverage else: # Exit block with an exception. raise Exception("BOOM!") From 731237c5fb369a0b3e626a238521caefd3744ac4 Mon Sep 17 00:00:00 2001 From: Aymeric Augustin Date: Thu, 11 Nov 2021 20:16:58 +0100 Subject: [PATCH 3/3] Work around bug in mypy. --- src/websockets/legacy/protocol.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/websockets/legacy/protocol.py b/src/websockets/legacy/protocol.py index a52f9f71d..3340c33be 100644 --- a/src/websockets/legacy/protocol.py +++ b/src/websockets/legacy/protocol.py @@ -750,7 +750,7 @@ async def close(self, code: int = 1000, reason: str = "") -> None: self.write_close_frame(Close(code, reason)), self.close_timeout, **loop_if_py_lt_38(self.loop), - ) + ) # type: ignore # remove when removing loop_if_py_lt_38 except asyncio.TimeoutError: # If the close frame cannot be sent because the send buffers # are full, the closing handshake won't complete anyway. @@ -771,7 +771,7 @@ async def close(self, code: int = 1000, reason: str = "") -> None: self.transfer_data_task, self.close_timeout, **loop_if_py_lt_38(self.loop), - ) + ) # type: ignore # remove when removing loop_if_py_lt_38 except (asyncio.TimeoutError, asyncio.CancelledError): pass @@ -1250,7 +1250,7 @@ async def keepalive_ping(self) -> None: pong_waiter, self.ping_timeout, **loop_if_py_lt_38(self.loop), - ) + ) # type: ignore # remove when removing loop_if_py_lt_38 self.logger.debug("% received keepalive pong") except asyncio.TimeoutError: if self.debug: @@ -1365,7 +1365,7 @@ async def wait_for_connection_lost(self) -> bool: asyncio.shield(self.connection_lost_waiter), self.close_timeout, **loop_if_py_lt_38(self.loop), - ) + ) # type: ignore # remove when removing loop_if_py_lt_38 except asyncio.TimeoutError: pass # Re-check self.connection_lost_waiter.done() synchronously because