Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32.4k
bpo-35983: improve and test old trashcan macros#12607
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
You need to merge/rebase and fix conflicts now. |
|
Done |
I'm not sure it's safe to change the meaning of the old macros.@benjaminp@serhiy-storchaka What do you think? |
They are already changed as part of#11841. This is just changing them in a safer way. |
AFAICT, |
I see what you mean. Let me be very precise what this PR will fix and what it will break, hopefully clarifying things: This willfix a crash in this case:
This willadd a new crash in this case:
I consider the first set of conditions more likely than the second, so this will fix more crashes than it introduces. But I cannot deny the possibility that it will break stuff. |
Uh oh!
There was an error while loading.Please reload this page.
This is a follow-up to#11841. I made a separate PR since that one has been reviewed already.
I realized that the backwards-compatibility macros
Py_TRASHCAN_SAFE_BEGIN(op)
can be made safe by only using the trashcan if the class inherits directly fromobject
. That case is safe and it's also a very common case (few builtin types have a non-trivial subtype).https://bugs.python.org/issue35983