Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 507896d

Browse files
authored
gh-116936: Add PyType_GetModuleByDef() to the limited C API (#116937)
1 parent 0c1a42c commit 507896d

File tree

8 files changed

+14
-1
lines changed

8 files changed

+14
-1
lines changed

Doc/data/stable_abi.dat

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Doc/whatsnew/3.13.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1742,6 +1742,9 @@ New Features
17421742
:term:`strong reference` to the constant zero.
17431743
(Contributed by Victor Stinner in :gh:`115754`.)
17441744

1745+
* Add :c:func:`PyType_GetModuleByDef` to the limited C API
1746+
(Contributed by Victor Stinner in :gh:`116936`.)
1747+
17451748

17461749
Porting to Python 3.13
17471750
----------------------

Include/cpython/object.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,6 @@ typedef struct _heaptypeobject {
275275

276276
PyAPI_FUNC(const char *) _PyType_Name(PyTypeObject *);
277277
PyAPI_FUNC(PyObject *) _PyType_Lookup(PyTypeObject *, PyObject *);
278-
PyAPI_FUNC(PyObject *) PyType_GetModuleByDef(PyTypeObject *, PyModuleDef *);
279278
PyAPI_FUNC(PyObject *) PyType_GetDict(PyTypeObject *);
280279

281280
PyAPI_FUNC(int) PyObject_Print(PyObject *, FILE *, int);

Include/object.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1247,6 +1247,10 @@ static inline int PyType_CheckExact(PyObject *op) {
12471247
# define PyType_CheckExact(op) PyType_CheckExact(_PyObject_CAST(op))
12481248
#endif
12491249

1250+
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030d0000
1251+
PyAPI_FUNC(PyObject *) PyType_GetModuleByDef(PyTypeObject *, PyModuleDef *);
1252+
#endif
1253+
12501254
#ifdef __cplusplus
12511255
}
12521256
#endif

Lib/test/test_stable_abi_ctypes.py

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Add :c:func:`PyType_GetModuleByDef` to the limited C API. Patch by Victor
2+
Stinner.

Misc/stable_abi.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2504,3 +2504,5 @@
25042504
added = '3.13'
25052505
[function.Py_GetConstantBorrowed]
25062506
added = '3.13'
2507+
[function.PyType_GetModuleByDef]
2508+
added = '3.13'

PC/python3dll.c

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)