summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2023-06-06 09:54:23 (GMT)
committerGitHub <noreply@github.com>2023-06-06 09:54:23 (GMT)
commit8ddf0dd264acafda29dc587ab8393387bb9a76ab (patch)
treec471b0ee9bfe527fc383b3125a36de41cfcba762
parent49fe2e4af7993c124b98589ee608ed6ba2cee8e6 (diff)
downloadcpython-8ddf0dd264acafda29dc587ab8393387bb9a76ab.zip
cpython-8ddf0dd264acafda29dc587ab8393387bb9a76ab.tar.gz
cpython-8ddf0dd264acafda29dc587ab8393387bb9a76ab.tar.bz2
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.
-rw-r--r--Doc/whatsnew/3.13.rst7
-rw-r--r--Include/cpython/objimpl.h8
-rw-r--r--Misc/NEWS.d/next/C API/2023-06-06-10-57-18.gh-issue-105268.OTJUko.rst3
3 files changed, 10 insertions, 8 deletions
diff --git a/Doc/whatsnew/3.13.rst b/Doc/whatsnew/3.13.rst
index 3b19e96..da6c8c9 100644
--- a/Doc/whatsnew/3.13.rst
+++ b/Doc/whatsnew/3.13.rst
@@ -489,3 +489,10 @@ Removed
* or :c:func:`PyGILState_Ensure` and :c:func:`PyGILState_Release`.
(Contributed by Victor Stinner in :gh:`105182`.)
+
+* 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
+ <https://github.com/python/pythoncapi-compat/>`_ 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 5a8cdd5..58a30ae 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 0000000..bdabfc8
--- /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.