Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 729eca1

Browse files
committed
For functions which return a PyObject* but use "null" for the
reference count field, state that the return value is always NULL. (Useful for some PyErr_*() flavors.)
1 parent 0a863da commit 729eca1

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

Doc/tools/anno-api.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,11 @@ def main():
4949
sys.stderr.write("No refcount data for %s\n" % s)
5050
else:
5151
if info.result_type == "PyObject*":
52-
rc = info.result_refs and "New" or "Borrowed"
52+
if info.result_refs is None:
53+
rc = "Always \NULL{}"
54+
else:
55+
rc = info.result_refs and "New" or "Borrowed"
56+
rc = rc + " reference"
5357
line = r"\begin{cfuncdesc}[%s]{PyObject*}{" % rc \
5458
+ line[prefix_len:]
5559
output.write(line)

0 commit comments

Comments
 (0)