[pypy-commit] pypy py3.5: hg merge default
rlamy
pypy.commits at gmail.com
Mon Feb 13 14:41:54 EST 2017
Author: Ronan Lamy <ronan.lamy at gmail.com>
Branch: py3.5
Changeset: r90103:36c29756f6b7
Date: 2017-02-13 19:41 +0000
http://bitbucket.org/pypy/pypy/changeset/36c29756f6b7/
Log: hg merge default
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,13 @@
};
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 */
+} PyCFunctionObject;
+
/* from structmember.h */
typedef struct PyMemberDef {
/* Current version, use this */
More information about the pypy-commit
mailing list