]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-105927: _abc and _thread use PyWeakref_GetRef() (#105961)
authorVictor Stinner <vstinner@python.org>
Wed, 21 Jun 2023 13:44:25 +0000 (15:44 +0200)
committerGitHub <noreply@github.com>
Wed, 21 Jun 2023 13:44:25 +0000 (15:44 +0200)
commitfb1e691e4bc7757c11bf9e51dda675f15537db8c
tree6bc8c40a35e6ccbc6c0f97f628a771b8df73f97a
parenteaa670228066220f08c8d73f80365c50058d40b8
gh-105927: _abc and _thread use PyWeakref_GetRef() (#105961)

Hold a strong reference on the object, rather than using a borrowed reference:
replace PyWeakref_GET_OBJECT() with PyWeakref_GetRef() and
_PyWeakref_GET_REF().

Remove assert(PyWeakref_CheckRef(localweakref)) since it's already
tested by _PyWeakref_GET_REF().
Modules/_abc.c
Modules/_threadmodule.c