summaryrefslogtreecommitdiffstats
path: root/Include
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2024-03-25 16:32:20 (GMT)
committerGitHub <noreply@github.com>2024-03-25 16:32:20 (GMT)
commit507896d97dcff2d7999efa264b29d9003c525c49 (patch)
treef46d689010f34344f60e86adac8e9fdb33867e3d /Include
parent0c1a42cf9c8cd0d4534d5c1d58f118ce7c5c446e (diff)
downloadcpython-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.h1
-rw-r--r--Include/object.h4
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