[3.14] gh-132775: Use _PyObject_GetXIData (With Fallback) (gh-134507)

This change includes some semi-related refactoring of queues and channels.

(cherry picked from commit d0eedfa10e, gh-134440)

Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
This commit is contained in:
Miss Islington (bot) 2025-05-22 15:21:05 +02:00 committed by GitHub
parent 59cb829eb9
commit 85c8c0a003
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 485 additions and 437 deletions

View file

@ -1839,6 +1839,7 @@ _sharednsitem_set_value(_PyXI_namespace_item *item, PyObject *value)
return -1;
}
PyThreadState *tstate = PyThreadState_Get();
// XXX Use _PyObject_GetXIDataWithFallback()?
if (_PyObject_GetXIDataNoFallback(tstate, value, item->xidata) != 0) {
PyMem_RawFree(item->xidata);
item->xidata = NULL;