Skip to content

Commit ce51c18

Browse files
vstinnerencukou
andauthored
gh-146063: Add PyObject_CallFinalizerFromDealloc() to the limited C API (#146172)
Co-authored-by: Petr Viktorin <encukou@gmail.com>
1 parent fc96028 commit ce51c18

8 files changed

Lines changed: 13 additions & 2 deletions

File tree

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.15.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2050,6 +2050,10 @@ New features
20502050

20512051
(Contributed by Victor Stinner in :gh:`141510`.)
20522052

2053+
* Add :c:func:`PyObject_CallFinalizerFromDealloc` function to the limited C
2054+
API.
2055+
(Contributed by Victor Stinner in :gh:`146063`.)
2056+
20532057
* Add :c:func:`PySys_GetAttr`, :c:func:`PySys_GetAttrString`,
20542058
:c:func:`PySys_GetOptionalAttr`, and :c:func:`PySys_GetOptionalAttrString`
20552059
functions as replacements for :c:func:`PySys_GetObject`.

Include/cpython/object.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,6 @@ Py_DEPRECATED(3.15) PyAPI_FUNC(PyObject*) _PyObject_GetAttrId(PyObject *, _Py_Id
307307

308308
PyAPI_FUNC(PyObject **) _PyObject_GetDictPtr(PyObject *);
309309
PyAPI_FUNC(void) PyObject_CallFinalizer(PyObject *);
310-
PyAPI_FUNC(int) PyObject_CallFinalizerFromDealloc(PyObject *);
311310

312311
PyAPI_FUNC(void) PyUnstable_Object_ClearWeakRefsNoCallbacks(PyObject *);
313312

Include/object.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -782,6 +782,7 @@ PyAPI_FUNC(int) PyType_Freeze(PyTypeObject *type);
782782
#endif
783783

784784
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= _Py_PACK_VERSION(3, 15)
785+
PyAPI_FUNC(int) PyObject_CallFinalizerFromDealloc(PyObject *);
785786
PyAPI_FUNC(PyObject *) PyType_GetModuleByToken(PyTypeObject *type,
786787
const void *token);
787788
PyAPI_FUNC(void *) PyObject_GetTypeData_DuringGC(PyObject *obj,

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:`PyObject_CallFinalizerFromDealloc` function to the limited C API.
2+
Patch by Victor Stinner.

Misc/stable_abi.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2691,7 +2691,6 @@
26912691
added = '3.15'
26922692

26932693
# PEP 757 import/export API.
2694-
26952694
[function.PyLong_GetNativeLayout]
26962695
added = '3.15'
26972696
[function.PyLong_Export]
@@ -2715,3 +2714,6 @@
27152714
# Note: The `_reserved` member of this struct is for interal use only.
27162715
# (The definition of 'full-abi' was clarified when this entry was added.)
27172716
struct_abi_kind = 'full-abi'
2717+
2718+
[function.PyObject_CallFinalizerFromDealloc]
2719+
added = '3.15'

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)