8000 gh-101476: Add _PyType_GetModuleState by erlend-aasland · Pull Request #101477 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-101476: Add _PyType_GetModuleState #101477

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Feb 23, 2023
Merged
Prev Previous commit
Revert name change
  • Loading branch information
erlend-aasland committed Feb 23, 2023
commit 049ace5f813d1947cd37f3708d0d0ec85e4ac531
2 changes: 1 addition & 1 deletion Include/internal/pycore_typeobject.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ _PyStaticType_GET_WEAKREFS_LISTPTR(static_builtin_state *state)
/* Like PyType_GetModuleState, but skips verification
* that type is a heap type with an associated module */
static inline void *
_PyType_GET_MODULE_STATE(PyTypeObject *type)
_PyType_GetModuleState(PyTypeObject *type)
C676
{
assert(PyType_Check(type));
assert(type->tp_flags & Py_TPFLAGS_HEAPTYPE);
Expand Down
4 changes: 2 additions & 2 deletions Modules/itertoolsmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include "pycore_call.h" // _PyObject_CallNoArgs()
#include "pycore_long.h" // _PyLong_GetZero()
#include "pycore_moduleobject.h" // _PyModule_GetState()
#include "pycore_typeobject.h" // _PyType_GET_MODULE_STATE()
#include "pycore_typeobject.h" // _PyType_GetModuleState()
#include "pycore_object.h" // _PyObject_GC_TRACK()
#include "pycore_tuple.h" // _PyTuple_ITEMS()
#include "structmember.h" // PyMemberDef
Expand Down Expand Up @@ -49,7 +49,7 @@ get_module_state(PyObject *mod)
static inline itertools_state *
get_module_state_by_cls(PyTypeObject *cls)
{
void *state = _PyType_GET_MODULE_STATE(cls);
void *state = _PyType_GetModuleState(cls);
assert(state != NULL);
return (itertools_state *)state;
}
Expand Down
0