mirror of
https://github.com/python/cpython.git
synced 2025-07-07 19:35:27 +00:00
gh-108342: Break ref cycle in SSLSocket._create() exc (#108344)
Explicitly break a reference cycle when SSLSocket._create() raises an exception. Clear the variable storing the exception, since the exception traceback contains the variables and so creates a reference cycle. This test leak was introduced by the test added for the fix of #108310.
This commit is contained in:
parent
9173b2bbe1
commit
64f9935035
1 changed files with 5 additions and 1 deletions
|
@ -1021,7 +1021,11 @@ class SSLSocket(socket):
|
|||
self.close()
|
||||
except OSError:
|
||||
pass
|
||||
raise notconn_pre_handshake_data_error
|
||||
try:
|
||||
raise notconn_pre_handshake_data_error
|
||||
finally:
|
||||
# Explicitly break the reference cycle.
|
||||
notconn_pre_handshake_data_error = None
|
||||
else:
|
||||
connected = True
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue