From 0600c9174141509988fdf728644ad2c4892c75a9 Mon Sep 17 00:00:00 2001 From: Itamar Oren Date: Mon, 15 Jun 2026 18:09:46 -0700 Subject: [PATCH] gh-151522: Guard against None transport in slow-socket SSL test --- Lib/test/test_asyncio/test_ssl.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Lib/test/test_asyncio/test_ssl.py b/Lib/test/test_asyncio/test_ssl.py index ca15fc3bdd42dd7..784c784d261dc66 100644 --- a/Lib/test/test_asyncio/test_ssl.py +++ b/Lib/test/test_asyncio/test_ssl.py @@ -1544,6 +1544,9 @@ async def client(addr): # This triggers bug gh-115514, also tested using mocks in # test.test_asyncio.test_selector_events.SelectorSocketTransportTests.test_write_buffer_after_close socket_transport = writer.transport._ssl_protocol._transport + # connection_lost may have already cleared _transport. + if socket_transport is None: + return class SocketWrapper: def __init__(self, sock) -> None: