mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
bpo-46613: Add PyType_GetModuleByDef to the public API (GH-31081)
* Make PyType_GetModuleByDef public (remove underscore) Co-authored-by: Victor Stinner <vstinner@python.org>
This commit is contained in:
parent
e0bcfd0e4d
commit
204946986f
21 changed files with 56 additions and 36 deletions
|
@ -786,7 +786,7 @@ local_new(PyTypeObject *type, PyObject *args, PyObject *kw)
|
|||
}
|
||||
}
|
||||
|
||||
PyObject *module = _PyType_GetModuleByDef(type, &thread_module);
|
||||
PyObject *module = PyType_GetModuleByDef(type, &thread_module);
|
||||
thread_module_state *state = get_thread_state(module);
|
||||
|
||||
localobject *self = (localobject *)type->tp_alloc(type, 0);
|
||||
|
@ -925,7 +925,7 @@ _ldict(localobject *self, thread_module_state *state)
|
|||
static int
|
||||
local_setattro(localobject *self, PyObject *name, PyObject *v)
|
||||
{
|
||||
PyObject *module = _PyType_GetModuleByDef(Py_TYPE(self), &thread_module);
|
||||
PyObject *module = PyType_GetModuleByDef(Py_TYPE(self), &thread_module);
|
||||
thread_module_state *state = get_thread_state(module);
|
||||
|
||||
PyObject *ldict = _ldict(self, state);
|
||||
|
@ -977,7 +977,7 @@ static PyType_Spec local_type_spec = {
|
|||
static PyObject *
|
||||
local_getattro(localobject *self, PyObject *name)
|
||||
{
|
||||
PyObject *module = _PyType_GetModuleByDef(Py_TYPE(self), &thread_module);
|
||||
PyObject *module = PyType_GetModuleByDef(Py_TYPE(self), &thread_module);
|
||||
thread_module_state *state = get_thread_state(module);
|
||||
|
||||
PyObject *ldict = _ldict(self, state);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue