summaryrefslogtreecommitdiffstats
path: root/Doc/tools/anno-api.py
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>2000-09-12 20:47:29 (GMT)
committerFred Drake <fdrake@acm.org>2000-09-12 20:47:29 (GMT)
commit0b25053ca0c65981e85374ab340714dda48dde5a (patch)
tree02c92528b3a66a5c4e28fc10ac521a62a1495b2e /Doc/tools/anno-api.py
parentdf13b9ff9d7c89727527d4482fccf0eeacdee194 (diff)
downloadcpython-0b25053ca0c65981e85374ab340714dda48dde5a.zip
cpython-0b25053ca0c65981e85374ab340714dda48dde5a.tar.gz
cpython-0b25053ca0c65981e85374ab340714dda48dde5a.tar.bz2
Make this script handle PyVarObject* functions as well as PyObject*
functions.
Diffstat (limited to 'Doc/tools/anno-api.py')
-rwxr-xr-xDoc/tools/anno-api.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/Doc/tools/anno-api.py b/Doc/tools/anno-api.py
index eddb3eb..420f271 100755
--- a/Doc/tools/anno-api.py
+++ b/Doc/tools/anno-api.py
@@ -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()