[3.14] gh-132775: Support Fallbacks in _PyObject_GetXIData() (gh-134418)

It now supports a "full" fallback to _PyFunction_GetXIData() and then `_PyPickle_GetXIData()`.
There's also room for other fallback modes if that later makes sense.

(cherry picked from commit 88f8102a8f, AKA gh-133482)

Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
This commit is contained in:
Miss Islington (bot) 2025-05-21 16:47:56 +02:00 committed by GitHub
parent cd3395a8b1
commit 2ffc10bd39
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 32041 additions and 31540 deletions

View file

@ -286,7 +286,7 @@ register_memoryview_xid(PyObject *mod, PyTypeObject **p_state)
*p_state = cls;
// Register XID for the builtin memoryview type.
if (ensure_xid_class(&PyMemoryView_Type, _pybuffer_shared) < 0) {
if (ensure_xid_class(&PyMemoryView_Type, GETDATA(_pybuffer_shared)) < 0) {
return -1;
}
// We don't ever bother un-registering memoryview.