Author: Richard Plangger <[email protected]>
Branch: py3k
Changeset: r86519:2a28c3d0f49d
Date: 2016-08-25 07:34 +0200
http://bitbucket.org/pypy/pypy/changeset/2a28c3d0f49d/
Log: revert last commit, remove already defined function in RPython (is
provided in C)
diff --git a/pypy/module/cpyext/api.py b/pypy/module/cpyext/api.py
--- a/pypy/module/cpyext/api.py
+++ b/pypy/module/cpyext/api.py
@@ -516,7 +516,7 @@
'PyObject_CallMethod', 'PyObject_CallFunctionObjArgs',
'PyObject_CallMethodObjArgs',
'_PyObject_CallFunction_SizeT', '_PyObject_CallMethod_SizeT',
- 'PyBuffer_Release',
+ 'PyObject_GetBuffer', 'PyBuffer_Release',
'PyCObject_FromVoidPtr', 'PyCObject_FromVoidPtrAndDesc',
'PyCObject_AsVoidPtr',
'PyCObject_GetDesc', 'PyCObject_Import', 'PyCObject_SetVoidPtr',
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
@@ -5,33 +5,8 @@
cpython_api, CANNOT_FAIL, Py_buffer)
from pypy.module.cpyext.pyobject import PyObject, Py_DecRef
-@cpython_api([PyObject], rffi.INT_real, error=CANNOT_FAIL)
-def PyObject_CheckBuffer(space, w_obj):
- """Return 1 if obj supports the buffer interface otherwise 0."""
- return 0 # the bf_getbuffer field is never filled by cpyext
-
-@cpython_api([PyObject, lltype.Ptr(Py_buffer), rffi.INT_real],
- rffi.INT_real, error=-1)
-def PyObject_GetBuffer(space, w_obj, view, flags):
- """Export obj into a Py_buffer, view. These arguments must
- never be NULL. The flags argument is a bit field indicating what
- kind of buffer the caller is prepared to deal with and therefore what
- kind of buffer the exporter is allowed to return. The buffer interface
- allows for complicated memory sharing possibilities, but some caller may
- not be able to handle all the complexity but may want to see if the
- exporter will let them take a simpler view to its memory.
-
- Some exporters may not be able to share memory in every possible way and
- may need to raise errors to signal to some consumers that something is
- just not possible. These errors should be a BufferError unless
- there is another error that is actually causing the problem. The
- exporter can use flags information to simplify how much of the
- Py_buffer structure is filled in with non-default values and/or
- raise an error if the object can't support a simpler view of its memory.
-
- 0 is returned on success and -1 on error."""
- raise oefmt(space.w_TypeError,
- "PyPy does not yet implement the new buffer interface")
+# PyObject_GetBuffer has been removed, it is defined in abstract.c
+# PyObject_CheckBuffer is also already defined
@cpython_api([lltype.Ptr(Py_buffer), lltype.Char], rffi.INT_real,
error=CANNOT_FAIL)
def PyBuffer_IsContiguous(space, view, fortran):
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit