gh-89373: _Py_Dealloc() checks tp_dealloc exception (#32357)

If Python is built in debug mode, _Py_Dealloc() now ensures that the
tp_dealloc function leaves the current exception unchanged.
This commit is contained in:
Victor Stinner 2022-04-21 23:04:01 +02:00 committed by GitHub
parent 8a4e519e78
commit 364ed94092
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 50 additions and 3 deletions

View file

@ -288,6 +288,7 @@ Effects of a debug build:
to detect usage of uninitialized objects.
* Ensure that functions which can clear or replace the current exception are
not called with an exception raised.
* Check that deallocator functions don't change the current exception.
* The garbage collector (:func:`gc.collect` function) runs some basic checks
on objects consistency.
* The :c:macro:`Py_SAFE_DOWNCAST()` macro checks for integer underflow and