diff --git a/Doc/c-api/module.rst b/Doc/c-api/module.rst index cfa6a1a985245e..b110443d927070 100644 --- a/Doc/c-api/module.rst +++ b/Doc/c-api/module.rst @@ -496,9 +496,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 @@ -513,6 +510,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``::