mirror of
https://github.com/python/cpython.git
synced 2025-08-30 21:48:47 +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
|
@ -8,24 +8,16 @@
|
|||
static int
|
||||
ensure_xid_class(PyTypeObject *cls, xidatafunc getdata)
|
||||
{
|
||||
PyInterpreterState *interp = PyInterpreterState_Get();
|
||||
_PyXIData_lookup_context_t ctx;
|
||||
if (_PyXIData_GetLookupContext(interp, &ctx) < 0) {
|
||||
return -1;
|
||||
}
|
||||
return _PyXIData_RegisterClass(&ctx, cls, getdata);
|
||||
PyThreadState *tstate = PyThreadState_Get();
|
||||
return _PyXIData_RegisterClass(tstate, cls, getdata);
|
||||
}
|
||||
|
||||
#ifdef REGISTERS_HEAP_TYPES
|
||||
static int
|
||||
clear_xid_class(PyTypeObject *cls)
|
||||
{
|
||||
PyInterpreterState *interp = PyInterpreterState_Get();
|
||||
_PyXIData_lookup_context_t ctx;
|
||||
if (_PyXIData_GetLookupContext(interp, &ctx) < 0) {
|
||||
return -1;
|
||||
}
|
||||
return _PyXIData_UnregisterClass(&ctx, cls);
|
||||
PyThreadState *tstate = PyThreadState_Get();
|
||||
return _PyXIData_UnregisterClass(tstate, cls);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue