Author: Ronan Lamy <[email protected]>
Branch: py3.5
Changeset: r89314:084daed91c42
Date: 2017-01-02 20:02 +0000
http://bitbucket.org/pypy/pypy/changeset/084daed91c42/
Log: Remove commented-out duplicate implementation of
PyMemoryView_GET_BUFFER
diff --git a/pypy/module/cpyext/memoryobject.py
b/pypy/module/cpyext/memoryobject.py
--- a/pypy/module/cpyext/memoryobject.py
+++ b/pypy/module/cpyext/memoryobject.py
@@ -214,30 +214,3 @@
# return the obj field of the Py_buffer created by PyMemoryView_GET_BUFFER
# XXX needed for numpy on py3k
raise NotImplementedError('PyMemoryView_GET_BASE')
-
-#XXX this function was removed in PyPy2, double-check that XXX
-#@cpython_api([PyObject], lltype.Ptr(Py_buffer), error=CANNOT_FAIL)
-#def PyMemoryView_GET_BUFFER(space, w_obj):
-# """Return a pointer to the buffer-info structure wrapped by the given
-# object. The object must be a memoryview instance; this macro doesn't
-# check its type, you must do it yourself or you will risk crashes."""
-# view = lltype.malloc(Py_buffer, flavor='raw', zero=True)
-# if not isinstance(w_obj, W_MemoryView):
-# return view
-# ndim = w_obj.buf.getndim()
-# if ndim >= Py_MAX_NDIMS:
-# # XXX warn?
-# return view
-# fill_Py_buffer(space, w_obj.buf, view)
-# try:
-# view.c_buf = rffi.cast(rffi.VOIDP, w_obj.buf.get_raw_address())
-# view.c_obj = make_ref(space, w_obj)
-# rffi.setintfield(view, 'c_readonly', w_obj.buf.readonly)
-# isstr = False
-# except ValueError:
-# w_s = w_obj.descr_tobytes(space)
-# view.c_obj = make_ref(space, w_s)
-# view.c_buf = rffi.cast(rffi.VOIDP, rffi.str2charp(space.str_w(w_s),
track_allocation=False))
-# rffi.setintfield(view, 'c_readonly', 1)
-# isstr = True
-# return view
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit