bpo-39947: Remove old private trashcan C API functions (GH-26869)

Remove 4 C API private trashcan functions which were only kept for
the backward compatibility of the stable ABI with Python 3.8 and
older, since the trashcan API was not usable with the limited C API
on Python 3.8 and older. The trashcan API was excluded from the
limited C API in Python 3.9.

Removed functions:

* _PyTrash_deposit_object()
* _PyTrash_destroy_chain()
* _PyTrash_thread_deposit_object()
* _PyTrash_thread_destroy_chain()

The trashcan C API was never usable with the limited C API, since old
trashcan macros accessed directly PyThreadState members like
"_tstate->trash_delete_nesting", whereas the PyThreadState structure
is opaque in the limited C API.

Exclude also the PyTrash_UNWIND_LEVEL constant from the C API.

The trashcan C API was modified in Python 3.9 by commit
38965ec541 and in Python 3.10 by commit
ed1a5a5bac to hide implementation
details.
This commit is contained in:
Victor Stinner 2021-06-23 15:51:47 +02:00 committed by GitHub
parent 2a396d65b8
commit db532a0999
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 30 additions and 78 deletions

View file

@ -37,10 +37,6 @@ EXPORT_FUNC(_PyObject_NewVar)
EXPORT_FUNC(_PyState_AddModule)
EXPORT_FUNC(_PyThreadState_Init)
EXPORT_FUNC(_PyThreadState_Prealloc)
EXPORT_FUNC(_PyTrash_deposit_object)
EXPORT_FUNC(_PyTrash_destroy_chain)
EXPORT_FUNC(_PyTrash_thread_deposit_object)
EXPORT_FUNC(_PyTrash_thread_destroy_chain)
EXPORT_FUNC(Py_AddPendingCall)
EXPORT_FUNC(Py_AtExit)
EXPORT_FUNC(Py_BuildValue)