bpo-36203: Check callback is callable in PyWeakref_NewRef#26273
bpo-36203: Check callback is callable in PyWeakref_NewRef#26273tekknolagi wants to merge 2 commits into
Conversation
The documentation says that `PyWeakref_NewRef` should raise a `TypeError` if the callback is not callable, None, or NULL, but the code does not reflect the documentation. This PR fixes that.
|
Tests failing seem entirely unrelated |
|
This PR is stale because it has been open for 30 days with no activity. |
|
bump? :) |
MaxwellDupre
left a comment
There was a problem hiding this comment.
Runs ok on my Ubuntu.
iritkatriel
left a comment
There was a problem hiding this comment.
This has merge conflicts now.
|
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
|
The following commit authors need to sign the Contributor License Agreement: |
| @@ -0,0 +1 @@ | |||
| Amend PyWeakref_New to raise a TypeError if the callback given is not NULL, None, or a callable object. The documentation previously falsely claimed this check occurred. No newline at end of file | |||
There was a problem hiding this comment.
| Amend PyWeakref_New to raise a TypeError if the callback given is not NULL, None, or a callable object. The documentation previously falsely claimed this check occurred. | |
| Amend :c:func:`PyWeakref_New` to raise :exc:`TypeError` if the *callback* given is not NULL, None, or a callable object. The documentation previously falsely claimed this check occurred. | |
|
The following commit authors need to sign the Contributor License Agreement: |
|
This PR is stale because it has been open for 30 days with no activity. |
|
I regrettably have no time to work on this. Please feel free to take over or close as appropriate. |
|
Superseded by #151145. |
The documentation says that
PyWeakref_NewRefshould raise aTypeErrorif the callback is not callable, None, or NULL, but the codedoes not reflect the documentation. This PR fixes that.
This should probably be backported to whatever version of Python
changed that documentation.
https://bugs.python.org/issue36203