From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Tue, 16 Jun 2026 05:54:42 +0000 (+0200) Subject: [3.15] gh-151522: Guard against None transport in slow-socket SSL test (GH-151523... X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=1a8e7435a5ef2b581a2866cfff28ea8de7a1c5cc;p=thirdparty%2FPython%2Fcpython.git [3.15] gh-151522: Guard against None transport in slow-socket SSL test (GH-151523) (#151528) gh-151522: Guard against None transport in slow-socket SSL test (GH-151523) (cherry picked from commit 11f032f904c8019b332a3c367f335e05cde63628) Co-authored-by: Itamar Oren --- diff --git a/Lib/test/test_asyncio/test_ssl.py b/Lib/test/test_asyncio/test_ssl.py index ca15fc3bdd42..784c784d261d 100644 --- a/Lib/test/test_asyncio/test_ssl.py +++ b/Lib/test/test_asyncio/test_ssl.py @@ -1544,6 +1544,9 @@ class TestSSL(test_utils.TestCase): # 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: