]> granicus.if.org Git - python/commitdiff
For functions which return a PyObject* but use "null" for the
authorFred Drake <fdrake@acm.org>
Mon, 10 Apr 2000 18:23:47 +0000 (18:23 +0000)
committerFred Drake <fdrake@acm.org>
Mon, 10 Apr 2000 18:23:47 +0000 (18:23 +0000)
reference count field, state that the return value is always NULL.

(Useful for some PyErr_*() flavors.)

Doc/tools/anno-api.py

index 33f85fba9279a7b2073f53aa85f2097423417562..eddb3eb796c2a7d045b12deaf75b155be7270b4d 100755 (executable)
@@ -49,7 +49,11 @@ def main():
                     sys.stderr.write("No refcount data for %s\n" % s)
                 else:
                     if info.result_type == "PyObject*":
-                        rc = info.result_refs and "New" or "Borrowed"
+                        if info.result_refs is None:
+                            rc = "Always \NULL{}"
+                        else:
+                            rc = info.result_refs and "New" or "Borrowed"
+                            rc = rc + " reference"
                         line = r"\begin{cfuncdesc}[%s]{PyObject*}{" % rc \
                                + line[prefix_len:]
             output.write(line)