Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 6f2b64f

Browse filesBrowse files
[3.8] gh-108342: Break ref cycle in SSLSocket._create() exc (GH-108344) (#108352)
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 GH-108310. (cherry picked from commit 64f9935) Co-authored-by: Victor Stinner <vstinner@python.org>
1 parent b4368b5 commit 6f2b64f
Copy full SHA for 6f2b64f

File tree

Expand file treeCollapse file tree

1 file changed

+5
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+5
-1
lines changed

‎Lib/ssl.py

Copy file name to clipboardExpand all lines: Lib/ssl.py
+5-1Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1048,7 +1048,11 @@ def _create(cls, sock, server_side=False, do_handshake_on_connect=True,
10481048
self.close()
10491049
except OSError:
10501050
pass
1051-
raise notconn_pre_handshake_data_error
1051+
try:
1052+
raise notconn_pre_handshake_data_error
1053+
finally:
1054+
# Explicitly break the reference cycle.
1055+
notconn_pre_handshake_data_error = None
10521056
else:
10531057
connected = True
10541058

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.