mirror of
https://github.com/python/cpython.git
synced 2024-11-27 03:45:08 +08: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
@ -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…
Reference in New Issue
Block a user