]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Make this script handle PyVarObject* functions as well as PyObject*
authorFred Drake <fdrake@acm.org>
Tue, 12 Sep 2000 20:47:29 +0000 (20:47 +0000)
committerFred Drake <fdrake@acm.org>
Tue, 12 Sep 2000 20:47:29 +0000 (20:47 +0000)
functions.

Doc/tools/anno-api.py

index eddb3eb796c2a7d045b12deaf75b155be7270b4d..420f27133edc3f53a27c6a2c41b74a3a81a23b9d 100755 (executable)
@@ -10,7 +10,7 @@ import sys
 import refcounts
 
 
-PREFIX = r"\begin{cfuncdesc}{PyObject*}{"
+PREFIX = r"\begin{cfuncdesc}{Py(Var|)Object*}{"
 
 
 def main():
@@ -48,14 +48,15 @@ def main():
                 except KeyError:
                     sys.stderr.write("No refcount data for %s\n" % s)
                 else:
-                    if info.result_type == "PyObject*":
+                    if info.result_type in ("PyObject*", "PyVarObject*"):
                         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:]
+                        line = (r"\begin{cfuncdesc}[%s]{%s}{"
+                                % (rc, info.result_type)) \
+                                + line[prefix_len:]
             output.write(line)
         if infile != "-":
             input.close()