-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
gh-105587: Remove assertion from _PyStaticObject_CheckRefcnt
#105638
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-105587: Remove assertion from _PyStaticObject_CheckRefcnt
#105638
Conversation
5862de0
to
bcdfa80
Compare
cc @ericsnowcurrently @kumaraditya303 let me know what you think! |
@sunmy2019 suggested to do a soft warning instead, which should be an easy change. So we can either keep the change as is, or go for a warning instead - I could go either just let me know what folks think! |
Making it a warning is a good idea. |
Sounds like a plan, fix coming up later today! |
SGTM, I'll review. |
@kumaraditya303 ready, this should do the trick |
Would it make sense to emit a |
@ericsnowcurrently as in a Python Warning right (i.e:
Thoughts? |
Both of your points are good ones. I retract my idea. 😄 |
_PyStaticObject_CheckRefcnt
Thanks @eduardo-elizondo for the PR, and @kumaraditya303 for merging it 🌮🎉.. I'm working now to backport this PR to: 3.12. |
…ythonGH-105638) (cherry picked from commit 6199fe3) Co-authored-by: Eddie Elizondo <[email protected]>
GH-105769 is a backport of this pull request to the 3.12 branch. |
…GH-105638) (#105769) gh-105587: Remove assertion from `_PyStaticObject_CheckRefcnt` (GH-105638) (cherry picked from commit 6199fe3) Co-authored-by: Eddie Elizondo <[email protected]>
|
Currently, we are using _PyStaticObject_CheckRefcnt to check the reference count of objects during runtime shutdown. However, this check can be incorrect if an Extension mutates the immortal reference count. Since we can't guarantee that this can't ever happen, let's instead just remove this check.