diff options
author | Victor Stinner <vstinner@python.org> | 2024-03-25 16:32:20 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-25 16:32:20 (GMT) |
commit | 507896d97dcff2d7999efa264b29d9003c525c49 (patch) | |
tree | f46d689010f34344f60e86adac8e9fdb33867e3d /Include | |
parent | 0c1a42cf9c8cd0d4534d5c1d58f118ce7c5c446e (diff) | |
download | cpython-507896d97dcff2d7999efa264b29d9003c525c49.zip cpython-507896d97dcff2d7999efa264b29d9003c525c49.tar.gz cpython-507896d97dcff2d7999efa264b29d9003c525c49.tar.bz2 |
gh-116936: Add PyType_GetModuleByDef() to the limited C API (#116937)
Diffstat (limited to 'Include')
-rw-r--r-- | Include/cpython/object.h | 1 | ||||
-rw-r--r-- | Include/object.h | 4 |
2 files changed, 4 insertions, 1 deletions
diff --git a/Include/cpython/object.h b/Include/cpython/object.h index 7512bb7..b64db1b 100644 --- a/Include/cpython/object.h +++ b/Include/cpython/object.h @@ -275,7 +275,6 @@ typedef struct _heaptypeobject { PyAPI_FUNC(const char *) _PyType_Name(PyTypeObject *); PyAPI_FUNC(PyObject *) _PyType_Lookup(PyTypeObject *, PyObject *); -PyAPI_FUNC(PyObject *) PyType_GetModuleByDef(PyTypeObject *, PyModuleDef *); PyAPI_FUNC(PyObject *) PyType_GetDict(PyTypeObject *); PyAPI_FUNC(int) PyObject_Print(PyObject *, FILE *, int); diff --git a/Include/object.h b/Include/object.h index 67a5e51..9679084 100644 --- a/Include/object.h +++ b/Include/object.h @@ -1247,6 +1247,10 @@ static inline int PyType_CheckExact(PyObject *op) { # define PyType_CheckExact(op) PyType_CheckExact(_PyObject_CAST(op)) #endif +#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030d0000 +PyAPI_FUNC(PyObject *) PyType_GetModuleByDef(PyTypeObject *, PyModuleDef *); +#endif + #ifdef __cplusplus } #endif |