mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
gh-132781: Cleanup Code Related to NotShareableError (gh-132782)
The following are added to the internal C-API: * _PyErr_FormatV() * _PyErr_SetModuleNotFoundError() * _PyXIData_GetNotShareableErrorType() * _PyXIData_FormatNotShareableError() We also drop _PyXIData_lookup_context_t and _PyXIData_GetLookupContext().
This commit is contained in:
parent
4c20f46fa0
commit
cd9536a087
14 changed files with 322 additions and 177 deletions
|
@ -1127,11 +1127,7 @@ queue_destroy(_queues *queues, int64_t qid)
|
|||
static int
|
||||
queue_put(_queues *queues, int64_t qid, PyObject *obj, int fmt, int unboundop)
|
||||
{
|
||||
PyInterpreterState *interp = PyInterpreterState_Get();
|
||||
_PyXIData_lookup_context_t ctx;
|
||||
if (_PyXIData_GetLookupContext(interp, &ctx) < 0) {
|
||||
return -1;
|
||||
}
|
||||
PyThreadState *tstate = PyThreadState_Get();
|
||||
|
||||
// Look up the queue.
|
||||
_queue *queue = NULL;
|
||||
|
@ -1147,12 +1143,13 @@ queue_put(_queues *queues, int64_t qid, PyObject *obj, int fmt, int unboundop)
|
|||
_queue_unmark_waiter(queue, queues->mutex);
|
||||
return -1;
|
||||
}
|
||||
if (_PyObject_GetXIData(&ctx, obj, data) != 0) {
|
||||
if (_PyObject_GetXIData(tstate, obj, data) != 0) {
|
||||
_queue_unmark_waiter(queue, queues->mutex);
|
||||
GLOBAL_FREE(data);
|
||||
return -1;
|
||||
}
|
||||
assert(_PyXIData_INTERPID(data) == PyInterpreterState_GetID(interp));
|
||||
assert(_PyXIData_INTERPID(data) ==
|
||||
PyInterpreterState_GetID(tstate->interp));
|
||||
|
||||
// Add the data to the queue.
|
||||
int64_t interpid = -1; // _queueitem_init() will set it.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue