Skip to content

Commit

Permalink
Mark code for removal.
Browse files Browse the repository at this point in the history
Refs #803.
  • Loading branch information
aaugustin committed Nov 21, 2020
1 parent 32c9036 commit 07775cf
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/websockets/asyncio_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ async def read_http_response(self) -> Tuple[int, Headers]:
"""
try:
status_code, reason, headers = await read_response(self.reader)
# Remove this branch when dropping support for Python < 3.8
# because CancelledError no longer inherits Exception.
except asyncio.CancelledError: # pragma: no cover
raise
except Exception as exc:
Expand Down
2 changes: 2 additions & 0 deletions src/websockets/asyncio_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ async def handler(self) -> None:
available_subprotocols=self.available_subprotocols,
extra_headers=self.extra_headers,
)
# Remove this branch when dropping support for Python < 3.8
# because CancelledError no longer inherits Exception.
except asyncio.CancelledError: # pragma: no cover
raise
except ConnectionError:
Expand Down
2 changes: 2 additions & 0 deletions src/websockets/protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -1169,6 +1169,8 @@ async def keepalive_ping(self) -> None:
self.fail_connection(1011)
break

# Remove this branch when dropping support for Python < 3.8
# because CancelledError no longer inherits Exception.
except asyncio.CancelledError:
raise

Expand Down

0 comments on commit 07775cf

Please sign in to comment.