8000 gh-108342: Break ref cycle in SSLSocket._create() exc by vstinner · Pull Request #108344 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-108342: Break ref cycle in SSLSocket._cr 8000 eate() exc #108344

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 23, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
gh-108342: Break ref cycle in SSLSocket._create() exc
Break explicitly 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.
  • Loading branch information
vstinner committed Aug 23, 2023
commit 7d384a23d09536dd1b4367648389916272f280c1
6 changes: 5 additions & 1 deletion Lib/ssl.py
Original file line number Diff line number Diff line change
Expand Up @@ -1021,7 +1021,11 @@ def _create(cls, sock, server_side=False, do_handshake_on_connect=True,
self.close()
except OSError:
pass
raise notconn_pre_handshake_data_error
try:
raise notconn_pre_handshake_data_error
finally:
# Break explicitly reference cycle
notconn_pre_handshake_data_error = None
else:
connected = True

Expand Down
0