[pypy-commit] pypy refactor-buffer-api: cpyext fix #1
Manuel Jacob
noreply at buildbot.pypy.org
Wed Aug 28 20:36:48 CEST 2013
Author: Manuel Jacob
Branch: refactor-buffer-api
Changeset: r66424:237e3312dceb
Date: 2013-08-28 19:37 +0100
http://bitbucket.org/pypy/pypy/changeset/237e3312dceb/
Log: cpyext fix #1
diff --git a/pypy/module/cpyext/bufferobject.py b/pypy/module/cpyext/bufferobject.py
--- a/pypy/module/cpyext/bufferobject.py
+++ b/pypy/module/cpyext/bufferobject.py
@@ -3,9 +3,10 @@
cpython_api, Py_ssize_t, cpython_struct, bootstrap_function,
PyObjectFields, PyObject)
from pypy.module.cpyext.pyobject import make_typedescr, Py_DecRef, make_ref
-from pypy.interpreter.buffer import Buffer, StringBuffer, SubBuffer
+from pypy.interpreter.buffer import StringBuffer, SubBuffer
from pypy.interpreter.error import OperationError
from pypy.module.array.interp_array import ArrayBuffer
+from pypy.module.__builtin__.interp_memoryview import W_Buffer
PyBufferObjectStruct = lltype.ForwardReference()
@@ -24,7 +25,7 @@
@bootstrap_function
def init_bufferobject(space):
"Type description of PyBufferObject"
- make_typedescr(space.gettypefor(Buffer).instancetypedef,
+ make_typedescr(space.gettypefor(W_Buffer).instancetypedef,
basestruct=PyBufferObject.TO,
attach=buffer_attach,
dealloc=buffer_dealloc,
diff --git a/pypy/module/cpyext/typeobject.py b/pypy/module/cpyext/typeobject.py
--- a/pypy/module/cpyext/typeobject.py
+++ b/pypy/module/cpyext/typeobject.py
@@ -28,7 +28,7 @@
PyNumberMethods, PyMappingMethods, PySequenceMethods, PyBufferProcs)
from pypy.module.cpyext.slotdefs import (
slotdefs_for_tp_slots, slotdefs_for_wrappers, get_slot_tp_function)
-from pypy.interpreter.buffer import Buffer
+from pypy.module.__builtin__.interp_memoryview import W_Buffer
from pypy.interpreter.error import OperationError
from rpython.rlib.rstring import rsplit
from rpython.rlib.objectmodel import specialize
@@ -509,7 +509,7 @@
# buffer protocol
if space.is_w(w_type, space.w_str):
setup_string_buffer_procs(space, pto)
- if space.is_w(w_type, space.gettypefor(Buffer)):
+ if space.is_w(w_type, space.gettypefor(W_Buffer)):
setup_buffer_buffer_procs(space, pto)
pto.c_tp_free = llhelper(PyObject_Del.api_func.functype,
More information about the pypy-commit
mailing list