Author: Ronan Lamy <ronan.l...@gmail.com>
Branch: fix-cpyext-releasebuffer
Changeset: r90482:ec8a1da6df33
Date: 2017-03-02 15:09 +0100
http://bitbucket.org/pypy/pypy/changeset/ec8a1da6df33/

Log:    Re-enable slot function filling for __buffer__ -> bf_getbuffer

diff --git a/pypy/module/cpyext/buffer.py b/pypy/module/cpyext/buffer.py
--- a/pypy/module/cpyext/buffer.py
+++ b/pypy/module/cpyext/buffer.py
@@ -13,10 +13,6 @@
     flags = pyobj.c_ob_type.c_tp_flags
     if (flags & Py_TPFLAGS_HAVE_NEWBUFFER and as_buffer.c_bf_getbuffer):
         return 1
-    name = rffi.charp2str(cts.cast('char*', pyobj.c_ob_type.c_tp_name))
-    if name in ('str', 'bytes'):
-        # XXX remove once wrapper of __buffer__ -> bf_getbuffer works
-        return 1
     return 0
 
 @cpython_api([lltype.Ptr(Py_buffer), PyObject, rffi.VOIDP, Py_ssize_t,
diff --git a/pypy/module/cpyext/slotdefs.py b/pypy/module/cpyext/slotdefs.py
--- a/pypy/module/cpyext/slotdefs.py
+++ b/pypy/module/cpyext/slotdefs.py
@@ -748,8 +748,6 @@
                 ret = fill_Py_buffer(space, buf, view)
                 return ret
             return 0
-        # XXX remove this when it no longer crashes a translated PyPy
-        return
         slot_func = buff_w
     else:
         # missing: tp_as_number.nb_nonzero, tp_as_number.nb_coerce
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to