mirror of
https://github.com/python/cpython.git
synced 2025-11-01 18:51:43 +00:00
gh-105927: PyWeakref_GetRef() returns 1 on success (#106561)
PyWeakref_GetRef() now returns 1 on success, and return 0 if the reference is dead. Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
This commit is contained in:
parent
1e12c8cfa3
commit
ee46cb6aa9
3 changed files with 6 additions and 4 deletions
|
|
@ -55,9 +55,11 @@ as much as it can.
|
|||
|
||||
Get a :term:`strong reference` to the referenced object from a weak
|
||||
reference, *ref*, into *\*pobj*.
|
||||
Return 0 on success. Raise an exception and return -1 on error.
|
||||
|
||||
If the referent is no longer live, set *\*pobj* to ``NULL`` and return 0.
|
||||
* On success, set *\*pobj* to a new :term:`strong reference` to the
|
||||
referenced object and return 1.
|
||||
* If the reference is dead, set *\*pobj* to ``NULL`` and return 0.
|
||||
* On error, raise an exception and return -1.
|
||||
|
||||
.. versionadded:: 3.13
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue