mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
gh-101944: Clarify PyModule_AddObjectRef() documentation (#129433)
This commit is contained in:
parent
39b754a359
commit
04264a286e
1 changed files with 4 additions and 3 deletions
|
@ -523,9 +523,6 @@ state:
|
|||
|
||||
On success, return ``0``. On error, raise an exception and return ``-1``.
|
||||
|
||||
Return ``-1`` if *value* is ``NULL``. It must be called with an exception
|
||||
raised in this case.
|
||||
|
||||
Example usage::
|
||||
|
||||
static int
|
||||
|
@ -540,6 +537,10 @@ state:
|
|||
return res;
|
||||
}
|
||||
|
||||
To be convenient, the function accepts ``NULL`` *value* with an exception
|
||||
set. In this case, return ``-1`` and just leave the raised exception
|
||||
unchanged.
|
||||
|
||||
The example can also be written without checking explicitly if *obj* is
|
||||
``NULL``::
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue