-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
bpo-44553 : Implement GC methods for types.Union #26993
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. I have just few nitpicks to the tests.
Thanks @Fidget-Spinner for the PR, and @serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this PR to: 3.10. |
(cherry picked from commit 1097384) Co-authored-by: Ken Jin <[email protected]>
GH-27002 is a backport of this pull request to the 3.10 branch. |
(cherry picked from commit 1097384) Co-authored-by: Ken Jin <[email protected]>
This commit seems to have broken the tracerefs buildbots: https://buildbot.python.org/all/#/builders/484/builds/322 |
if (result == NULL) { | ||
return NULL; | ||
} | ||
|
||
result->args = dedup_and_flatten_args(args); | ||
if (result->args == NULL) { | ||
Py_DECREF(result); | ||
PyObject_GC_Del(result); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is incorrect, this should still be Py_DECREF
, PyObject_GC_Del
cannot be called like that because it overrides a bunch of cleanups like the call to _Py_ForgetReference
.
https://bugs.python.org/issue44553