summaryrefslogtreecommitdiffstats
path: root/Modules/_interpqueuesmodule.c
diff options
context:
space:
mode:
authorEric Snow <ericsnowcurrently@gmail.com>2025-04-25 20:43:38 (GMT)
committerGitHub <noreply@github.com>2025-04-25 20:43:38 (GMT)
commitcd9536a0872046cc7c151b61b457975e7718274a (patch)
tree97aeb24d67a984a1eedd1ef0944463a4b2a3ef05 /Modules/_interpqueuesmodule.c
parent4c20f46fa011df57190cc19b21bafde1f65e73a7 (diff)
downloadcpython-cd9536a0872046cc7c151b61b457975e7718274a.zip
cpython-cd9536a0872046cc7c151b61b457975e7718274a.tar.gz
cpython-cd9536a0872046cc7c151b61b457975e7718274a.tar.bz2
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().
Diffstat (limited to 'Modules/_interpqueuesmodule.c')
-rw-r--r--Modules/_interpqueuesmodule.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/Modules/_interpqueuesmodule.c b/Modules/_interpqueuesmodule.c
index d069880..fdbf197 100644
--- a/Modules/_interpqueuesmodule.c
+++ b/Modules/_interpqueuesmodule.c
@@ -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.