Skip to content
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

gh-105927: _ssl GET_SOCKET() uses _PyWeakref_GET_REF() #106002

Merged
merged 1 commit into from
Jun 23, 2023

Conversation

vstinner
Copy link
Member

@vstinner vstinner commented Jun 22, 2023

@vstinner
Copy link
Member Author

I started hacking _ssl.c to use a strong reference, but the code is more complicated than what I expected. GET_SOCKET() returns NULL if there is no socket, None is the weak reference is dead, or a borrowed reference to the socket otherwise. It's not easy to migrate the code to strong references. So I only changed GET_SOCKET() but it still returns a borrowed reference.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants