Author: Armin Rigo <[email protected]>
Branch: py3.5
Changeset: r90116:b30c111d304e
Date: 2017-02-14 17:36 +0100
http://bitbucket.org/pypy/pypy/changeset/b30c111d304e/
Log: merge heads
diff --git a/pypy/module/_codecs/locale.py b/pypy/module/_codecs/locale.py
--- a/pypy/module/_codecs/locale.py
+++ b/pypy/module/_codecs/locale.py
@@ -58,7 +58,7 @@
errorpos = rffi.cast(lltype.Signed, errorposp[0])
if errorpos == -1:
raise MemoryError
- errmsg = _errmsg(u"pypy_wchar2char")
+ errmsg = _errmsg("pypy_wchar2char")
errorhandler('strict', 'filesystemencoding', errmsg, u,
errorpos, errorpos + 1)
return rffi.charp2str(sbuf)
@@ -81,7 +81,7 @@
ubuf = pypy_char2wchar(sbuf, sizep)
try:
if not ubuf:
- errmsg = _errmsg(u"pypy_char2wchar")
+ errmsg = _errmsg("pypy_char2wchar")
errorhandler('strict', 'filesystemencoding', errmsg, s, 0, 1)
size = rffi.cast(lltype.Signed, sizep[0])
return rawwcharp2unicoden(ubuf, size)
@@ -91,7 +91,7 @@
def _errmsg(what):
# I *think* that the functions in locale_codec.c don't set errno
- return u"%s failed" % what
+ return "%s failed" % what
class scoped_unicode2rawwcharp:
diff --git a/pypy/module/cpyext/include/methodobject.h
b/pypy/module/cpyext/include/methodobject.h
--- a/pypy/module/cpyext/include/methodobject.h
+++ b/pypy/module/cpyext/include/methodobject.h
@@ -7,14 +7,6 @@
extern "C" {
#endif
-typedef struct
-{
- PyObject_HEAD
- PyMethodDef *m_ml; /* Description of the C function to call */
- PyObject *m_self; /* Passed as 'self' arg to the C func, can be NULL */
- PyObject *m_module; /* The __module__ attribute, can be anything */
-} PyCFunctionObject;
-
/* Flag passed to newmethodobject */
#define METH_VARARGS 0x0001
#define METH_KEYWORDS 0x0002
diff --git a/pypy/module/cpyext/methodobject.py
b/pypy/module/cpyext/methodobject.py
--- a/pypy/module/cpyext/methodobject.py
+++ b/pypy/module/cpyext/methodobject.py
@@ -9,8 +9,8 @@
from pypy.objspace.std.typeobject import W_TypeObject
from pypy.module.cpyext.api import (
CONST_STRING, METH_CLASS, METH_COEXIST, METH_KEYWORDS, METH_NOARGS, METH_O,
- METH_STATIC, METH_VARARGS, PyObject, PyObjectFields, bootstrap_function,
- build_type_checkers, cpython_api, cpython_struct, generic_cpy_call,
+ METH_STATIC, METH_VARARGS, PyObject, bootstrap_function,
+ build_type_checkers, cpython_api, generic_cpy_call,
PyTypeObjectPtr, slot_function, cts)
from pypy.module.cpyext.pyobject import (
Py_DecRef, from_ref, make_ref, as_pyobj, make_typedescr)
@@ -18,14 +18,7 @@
PyMethodDef = cts.gettype('PyMethodDef')
PyCFunction = cts.gettype('PyCFunction')
PyCFunctionKwArgs = cts.gettype('PyCFunctionWithKeywords')
-PyCFunctionObjectStruct = cpython_struct(
- 'PyCFunctionObject',
- PyObjectFields + (
- ('m_ml', lltype.Ptr(PyMethodDef)),
- ('m_self', PyObject),
- ('m_module', PyObject),
- ))
-PyCFunctionObject = lltype.Ptr(PyCFunctionObjectStruct)
+PyCFunctionObject = cts.gettype('PyCFunctionObject*')
@bootstrap_function
def init_methodobject(space):
diff --git a/pypy/module/cpyext/parse/cpyext_object.h
b/pypy/module/cpyext/parse/cpyext_object.h
--- a/pypy/module/cpyext/parse/cpyext_object.h
+++ b/pypy/module/cpyext/parse/cpyext_object.h
@@ -188,6 +188,14 @@
};
typedef struct PyMethodDef PyMethodDef;
+typedef struct {
+ PyObject_HEAD
+ PyMethodDef *m_ml; /* Description of the C function to call */
+ PyObject *m_self; /* Passed as 'self' arg to the C func, can be NULL */
+ PyObject *m_module; /* The __module__ attribute, can be anything */
+ PyObject *m_weakreflist; /* List of weak references */
+} PyCFunctionObject;
+
/* from structmember.h */
typedef struct PyMemberDef {
/* Current version, use this */
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit