diff --git a/Doc/whatsnew/3.12.rst b/Doc/whatsnew/3.12.rst
index bf9eadcaefc853..039bd7c3df1e44 100644
--- a/Doc/whatsnew/3.12.rst
+++ b/Doc/whatsnew/3.12.rst
@@ -2045,3 +2045,10 @@ Removed
* Remove ``_use_broken_old_ctypes_structure_semantics_`` flag
from :mod:`ctypes` module.
(Contributed by Nikita Sobolev in :gh:`99285`.)
+
+* Remove the old private, undocumented and untested ``_PyGC_FINALIZED()`` macro
+ which was kept for backward compatibility with Python 3.8 and older: use
+ :c:func:`PyObject_GC_IsFinalized()` instead. The `pythoncapi-compat project
+ `_ can be used to get this
+ function on Python 3.8 and older.
+ (Contributed by Victor Stinner in :gh:`105268`.)
diff --git a/Include/cpython/objimpl.h b/Include/cpython/objimpl.h
index 5a8cdd57c7845b..58a30aeea6ac64 100644
--- a/Include/cpython/objimpl.h
+++ b/Include/cpython/objimpl.h
@@ -78,14 +78,6 @@ PyAPI_FUNC(void) PyObject_SetArenaAllocator(PyObjectArenaAllocator *allocator);
PyAPI_FUNC(int) PyObject_IS_GC(PyObject *obj);
-/* Code built with Py_BUILD_CORE must include pycore_gc.h instead which
- defines a different _PyGC_FINALIZED() macro. */
-#ifndef Py_BUILD_CORE
- // Kept for backward compatibility with Python 3.8
-# define _PyGC_FINALIZED(o) PyObject_GC_IsFinalized(o)
-#endif
-
-
// Test if a type supports weak references
PyAPI_FUNC(int) PyType_SUPPORTS_WEAKREFS(PyTypeObject *type);
diff --git a/Misc/NEWS.d/next/C API/2023-06-06-10-57-18.gh-issue-105268.OTJUko.rst b/Misc/NEWS.d/next/C API/2023-06-06-10-57-18.gh-issue-105268.OTJUko.rst
new file mode 100644
index 00000000000000..bdabfc8c203f6e
--- /dev/null
+++ b/Misc/NEWS.d/next/C API/2023-06-06-10-57-18.gh-issue-105268.OTJUko.rst
@@ -0,0 +1,3 @@
+Remove the old private, undocumented and untested ``_PyGC_FINALIZED()`` macro
+which was kept for backward compatibility with Python 3.8 and older. Patch by
+Victor Stinner.
pFad - Phonifier reborn
Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies:
Alternative Proxy
pFad Proxy
pFad v3 Proxy
pFad v4 Proxy