From d065c489910e86fb8ed7219205da65e224f03d94 Mon Sep 17 00:00:00 2001 From: Benjamin Peterson Date: Thu, 17 Apr 2014 18:29:01 -0400 Subject: [PATCH] fix ref count annotations on sphinx >= 1.2.1 (closes #21286) --- Doc/tools/sphinxext/c_annotations.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Doc/tools/sphinxext/c_annotations.py b/Doc/tools/sphinxext/c_annotations.py index 8b5167ac906..cf9ad9e7aca 100644 --- a/Doc/tools/sphinxext/c_annotations.py +++ b/Doc/tools/sphinxext/c_annotations.py @@ -81,7 +81,10 @@ def add_annotations(self, app, doctree): continue if not par[0].has_key('names') or not par[0]['names']: continue - entry = self.get(par[0]['names'][0]) + name = par[0]['names'][0] + if name.startswith("c."): + name = name[2:] + entry = self.get(name) if not entry: continue elif entry.result_type not in ("PyObject*", "PyVarObject*"):