We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5f40e3e commit 182d190Copy full SHA for 182d190
1 file changed
Doc/extending/error-handling.rst
@@ -53,7 +53,15 @@ we can see this in action:
53
54
55
``spam_system`` returns a ``PyObject *``, so we indicate failure by returning
56
-``NULL``. To expand on this, let's try to modify ``spam_system`` to raise an
+``NULL``.
57
+
58
+.. note::
59
60
+ Some functions in the C API return an ``int`` instead of a reference, so they
61
+ cannot use ``NULL`` for failure. These functions will usually return ``-1``
62
+ for failure, and ``0`` otherwise.
63
64
+To expand on this, let's try to modify ``spam_system`` to raise an
65
exception if the result is non-zero:
66
67
.. code-block:: c
0 commit comments