Author: Richard Plangger <planri...@gmail.com> Branch: py3.5 Changeset: r86475:a43d6aa79232 Date: 2016-08-24 11:59 +0200 http://bitbucket.org/pypy/pypy/changeset/a43d6aa79232/
Log: merge py3k 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 @@ -394,13 +394,6 @@ of the specified width. The string S is never truncated. """ - def descr_hex(self, space): - """S.hex() -> string - - Creates a hexadecimal string of the bytes object - """ - - class W_BytesObject(W_AbstractBytesObject): import_from_mixin(StringMethods) _immutable_fields_ = ['_value'] diff --git a/rpython/rlib/rposix.py b/rpython/rlib/rposix.py --- a/rpython/rlib/rposix.py +++ b/rpython/rlib/rposix.py @@ -223,7 +223,7 @@ pass if _WIN32: - includes = ['io.h', 'sys/utime.h', 'sys/types.h', 'process.h'] + includes = ['io.h', 'sys/utime.h', 'sys/types.h', 'process.h', 'time.h'] libraries = [] else: if sys.platform.startswith(('darwin', 'netbsd', 'openbsd')): @@ -254,10 +254,10 @@ UTIMBUF = rffi_platform.Struct('struct %sutimbuf' % UNDERSCORE_ON_WIN32, [('actime', rffi.INT), ('modtime', rffi.INT)]) + CLOCK_T = rffi_platform.SimpleType('clock_t', rffi.INT) if not _WIN32: UID_T = rffi_platform.SimpleType('uid_t', rffi.UINT) GID_T = rffi_platform.SimpleType('gid_t', rffi.UINT) - CLOCK_T = rffi_platform.SimpleType('clock_t', rffi.INT) TMS = rffi_platform.Struct( 'struct tms', [('tms_utime', rffi.INT), _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit