mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
gh-132775: Support Fallbacks in _PyObject_GetXIData() (gh-133482)
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.
This commit is contained in:
parent
0c5a8b0b55
commit
88f8102a8f
11 changed files with 581 additions and 139 deletions
|
@ -1143,7 +1143,7 @@ queue_put(_queues *queues, int64_t qid, PyObject *obj, int fmt, int unboundop)
|
|||
_queue_unmark_waiter(queue, queues->mutex);
|
||||
return -1;
|
||||
}
|
||||
if (_PyObject_GetXIData(tstate, obj, data) != 0) {
|
||||
if (_PyObject_GetXIDataNoFallback(tstate, obj, data) != 0) {
|
||||
_queue_unmark_waiter(queue, queues->mutex);
|
||||
GLOBAL_FREE(data);
|
||||
return -1;
|
||||
|
@ -1270,7 +1270,7 @@ set_external_queue_type(module_state *state, PyTypeObject *queue_type)
|
|||
}
|
||||
|
||||
// Add and register the new type.
|
||||
if (ensure_xid_class(queue_type, _queueobj_shared) < 0) {
|
||||
if (ensure_xid_class(queue_type, GETDATA(_queueobj_shared)) < 0) {
|
||||
return -1;
|
||||
}
|
||||
state->queue_type = (PyTypeObject *)Py_NewRef(queue_type);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue