8000 gh-105268: Remove _PyGC_FINALIZED() macro (#105350) · python/cpython@149ad93 · GitHub
[go: up one dir, main page]

Skip to content
8000

Commit 149ad93

Browse files
committed
gh-105268: Remove _PyGC_FINALIZED() macro (#105350)
Remove the old private, undocumented and untested _PyGC_FINALIZED() macro which was kept for backward compatibility with Python 3.8 and older. (cherry picked from commit 8ddf0dd)
1 parent e8963a8 commit 149ad93

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

Doc/whatsnew/3.12.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2045,3 +2045,10 @@ Removed
20452045
* Remove ``_use_broken_old_ctypes_structure_semantics_`` flag
20462046
from :mod:`ctypes` module.
20472047
(Contributed by Nikita Sobolev in :gh:`99285`.)
2048+
2049+
* Remove the old private, undocumented and untested ``_PyGC_FINALIZED()`` macro
2050+
which was kept for backward compatibility with Python 3.8 and older: use
2051+
:c:func:`PyObject_GC_IsFinalized()` instead. The `pythoncapi-compat project
2052+
<https://github.com/python/pythoncapi-compat/>`_ can be used to get this
2053+
function on Python 3.8 and older.
2054+
(Contributed by Victor Stinner in :gh:`105268`.)

Include/cpython/objimpl.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -78,14 +78,6 @@ PyAPI_FUNC(void) PyObject_SetArenaAllocator(PyObjectArenaAllocator *allocator);
7878
PyAPI_FUNC(int) PyObject_IS_GC(PyObject *obj);
7979

8080

81-
/* Code built with Py_BUILD_CORE must include pycore_gc.h instead which
82-
defines a different _PyGC_FINALIZED() macro. */
83-
#ifndef Py_BUILD_CORE
84-
// Kept for backward compatibility with Python 3.8
85-
# define _PyGC_FINALIZED(o) PyObject_GC_IsFinalized(o)
86-
#endif
87-
88-
8981
// Test if a type supports weak references
9082
PyAPI_FUNC(int) PyType_SUPPORTS_WEAKREFS(PyTypeObject *type);
9183

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Remove the old private, undocumented and untested ``_PyGC_FINALIZED()`` macro
2+
which was kept for backward compatibility with Python 3.8 and older. Patch by
3+
Victor Stinner.

0 commit comments

Comments
 (0)
0