Commit 08796381 authored by Mark Florisson's avatar Mark Florisson

Omit setting docstring for __getbuffer__/__releasebuffer__

--HG--
extra : transplant_source : %04%AD%9D%8Dy%E4%7F%D04ib%0E%90%DB%D48%C3%88%19g
parent c81b103a
......@@ -2353,7 +2353,10 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
# unless we let PyType_Ready create the slot wrappers we have
# a significant performance hit. (See trac #561.)
for func in entry.type.scope.pyfunc_entries:
if func.is_special and Options.docstrings and func.wrapperbase_cname:
is_buffer = func.name in ('__getbuffer__',
'__releasebuffer__')
if (func.is_special and Options.docstrings and
func.wrapperbase_cname and not is_buffer):
code.putln('#if CYTHON_COMPILING_IN_CPYTHON')
code.putln("{")
code.putln(
......
......@@ -52,3 +52,9 @@ cdef class TestBuffer:
cdef class TestBufferRelease(TestBuffer):
def __releasebuffer__(self, Py_buffer* buffer):
print u"releasing!"
cdef class TestCompileWithDocstring(object):
def __getbuffer__(self, Py_buffer* buffer, int flags):
"I am a docstring!"
def __releasebuffer__(self, Py_buffer* buf):
"I am a docstring!"
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment