Commit 73895001 authored by Mark Florisson's avatar Mark Florisson

Omit setting docstring for __getbuffer__/__releasebuffer__

parent 80d79c97
......@@ -2355,7 +2355,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