mirror of
https://github.com/python/cpython.git
synced 2025-12-23 09:19:18 +00:00
[3.12] gh-105375: Harden error handling in _testcapi/heaptype.c (GH-105608) (#105615)
Bail on first error in heapctypesubclasswithfinalizer_finalize()
(cherry picked from commit d636d7dfe7)
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
This commit is contained in:
parent
5dae2b1a5d
commit
4fbbf699c0
1 changed files with 4 additions and 1 deletions
|
|
@ -661,8 +661,11 @@ heapctypesubclasswithfinalizer_finalize(PyObject *self)
|
|||
goto cleanup_finalize;
|
||||
}
|
||||
oldtype = PyObject_GetAttrString(m, "HeapCTypeSubclassWithFinalizer");
|
||||
if (oldtype == NULL) {
|
||||
goto cleanup_finalize;
|
||||
}
|
||||
newtype = PyObject_GetAttrString(m, "HeapCTypeSubclass");
|
||||
if (oldtype == NULL || newtype == NULL) {
|
||||
if (newtype == NULL) {
|
||||
goto cleanup_finalize;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue