[pypy-commit] pypy py3k: buffer protocal c headers are stripped down in py3
plan_rich
pypy.commits at gmail.com
Wed Aug 24 05:58:02 EDT 2016
Author: Richard Plangger <planrichi at gmail.com>
Branch: py3k
Changeset: r86474:d5bd69e6035c
Date: 2016-08-24 11:56 +0200
http://bitbucket.org/pypy/pypy/changeset/d5bd69e6035c/
Log: buffer protocal c headers are stripped down in py3
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
@@ -11,7 +11,7 @@
getattrfunc, getattrofunc, setattrofunc, lenfunc, ssizeargfunc, inquiry,
ssizessizeargfunc, ssizeobjargproc, iternextfunc, initproc, richcmpfunc,
cmpfunc, hashfunc, descrgetfunc, descrsetfunc, objobjproc, objobjargproc,
- getbufferproc, readbufferproc, ssizessizeobjargproc)
+ getbufferproc, ssizessizeobjargproc)
from pypy.module.cpyext.pyobject import from_ref, make_ref, Py_DecRef
from pypy.module.cpyext.pyerrors import PyErr_Occurred
from pypy.module.cpyext.state import State
@@ -22,6 +22,9 @@
from rpython.rlib.objectmodel import specialize
from rpython.tool.sourcetools import func_renamer
from rpython.rtyper.annlowlevel import llhelper
+from pypy.module.sys.version import CPYTHON_VERSION
+
+PY3 = CPYTHON_VERSION[0] == 3
# XXX: Also defined in object.h
Py_LT = 0
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
@@ -14,7 +14,7 @@
from pypy.module.cpyext import structmemberdefs
from pypy.module.cpyext.api import (
cpython_api, cpython_struct, bootstrap_function, Py_ssize_t, Py_ssize_tP,
- generic_cpy_call, Py_TPFLAGS_READY, Py_TPFLAGS_READYING,
+ generic_cpy_call, Py_TPFLAGS_READY, Py_TPFLAGS_READYING, Py_buffer,
Py_TPFLAGS_HEAPTYPE, METH_VARARGS, METH_KEYWORDS, CANNOT_FAIL,
Py_TPFLAGS_HAVE_GETCHARBUFFER, build_type_checkers, StaticObjectBuilder,
PyObjectFields, Py_TPFLAGS_BASETYPE, PyTypeObject, PyTypeObjectPtr,
diff --git a/pypy/module/cpyext/typeobjectdefs.py b/pypy/module/cpyext/typeobjectdefs.py
--- a/pypy/module/cpyext/typeobjectdefs.py
+++ b/pypy/module/cpyext/typeobjectdefs.py
@@ -1,7 +1,7 @@
from rpython.rtyper.lltypesystem import rffi, lltype
from rpython.rtyper.lltypesystem.lltype import Ptr, FuncType, Void
from pypy.module.cpyext.api import (cpython_struct, Py_ssize_t, Py_ssize_tP,
- PyVarObjectFields, PyTypeObject, PyTypeObjectPtr, FILEP, Py_Buffer,
+ PyVarObjectFields, PyTypeObject, PyTypeObjectPtr, FILEP, Py_buffer,
Py_TPFLAGS_READYING, Py_TPFLAGS_READY, Py_TPFLAGS_HEAPTYPE)
from pypy.module.cpyext.pyobject import PyObject, make_ref, from_ref
from pypy.module.cpyext.modsupport import PyMethodDef
@@ -54,10 +54,6 @@
wrapperfunc = P(FT([PyO, PyO, rffi.VOIDP], PyO))
wrapperfunc_kwds = P(FT([PyO, PyO, rffi.VOIDP, PyO], PyO))
-readbufferproc = P(FT([PyO, Py_ssize_t, rffi.VOIDPP], Py_ssize_t))
-writebufferproc = P(FT([PyO, Py_ssize_t, rffi.VOIDPP], Py_ssize_t))
-segcountproc = P(FT([PyO, Py_ssize_tP], Py_ssize_t))
-charbufferproc = P(FT([PyO, Py_ssize_t, rffi.CCHARPP], Py_ssize_t))
getbufferproc = P(FT([PyO, Py_bufferP, rffi.INT_real], rffi.INT_real))
releasebufferproc = P(FT([PyO, Py_bufferP], Void))
@@ -131,10 +127,6 @@
))
PyBufferProcs = cpython_struct("PyBufferProcs", (
- ("bf_getreadbuffer", readbufferproc),
- ("bf_getwritebuffer", writebufferproc),
- ("bf_getsegcount", segcountproc),
- ("bf_getcharbuffer", charbufferproc),
("bf_getbuffer", getbufferproc),
("bf_releasebuffer", releasebufferproc),
))
diff --git a/pypy/objspace/std/bytesobject.py b/pypy/objspace/std/bytesobject.py
--- a/pypy/objspace/std/bytesobject.py
+++ b/pypy/objspace/std/bytesobject.py
@@ -15,9 +15,6 @@
from pypy.objspace.std import newformat
from pypy.objspace.std.formatting import mod_format
from pypy.objspace.std.stringmethods import StringMethods
-from pypy.objspace.std.unicodeobject import (
- decode_object, unicode_from_encoded_object,
- unicode_from_string, getdefaultencoding)
from pypy.objspace.std.util import IDTAG_SPECIAL, IDTAG_SHIFT
More information about the pypy-commit
mailing list