Skip to content

Commit

Permalink
Remove connector close workaround for older Python versions (#9818)
Browse files Browse the repository at this point in the history
  • Loading branch information
bdraco authored Nov 11, 2024
1 parent 5be7256 commit 0f18900
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 16 deletions.
4 changes: 0 additions & 4 deletions aiohttp/connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -698,10 +698,6 @@ def _release(
if self._force_close or should_close or protocol.should_close:
transport = protocol.transport
protocol.close()
# TODO: Remove once fixed: https://bugs.python.org/issue39951
# See PR #6321
set_result(protocol.closed, None)

if key.is_ssl and not self._cleanup_closed_disabled:
self._cleanup_closed_transports.append(transport)
return
Expand Down
12 changes: 0 additions & 12 deletions tests/test_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -586,18 +586,6 @@ async def test_release_close(key: ConnectionKey) -> None:
await conn.close()


async def test_release_proto_closed_future(
loop: asyncio.AbstractEventLoop, key: ConnectionKey
) -> None:
conn = aiohttp.BaseConnector()
protocol = mock.Mock(should_close=True, closed=loop.create_future())
conn._release(key, protocol)
# See PR #6321
assert protocol.closed.result() is None

await conn.close()


async def test__release_acquired_per_host1(
loop: asyncio.AbstractEventLoop, key: ConnectionKey
) -> None:
Expand Down

0 comments on commit 0f18900

Please sign in to comment.