Commit 74d10bf8 authored by Robert Bradshaw's avatar Robert Bradshaw

Merge branch 'master' of github.com:cython/cython

parents 0846423a 5968096a
...@@ -7518,7 +7518,7 @@ class BoundMethodNode(ExprNode): ...@@ -7518,7 +7518,7 @@ class BoundMethodNode(ExprNode):
def generate_result_code(self, code): def generate_result_code(self, code):
code.putln( code.putln(
"%s = PyMethod_New(%s, %s, (PyObject*)%s->ob_type); %s" % ( "%s = __Pyx_PyMethod_New(%s, %s, (PyObject*)%s->ob_type); %s" % (
self.result(), self.result(),
self.function.py_result(), self.function.py_result(),
self.self_object.py_result(), self.self_object.py_result(),
...@@ -7550,7 +7550,7 @@ class UnboundMethodNode(ExprNode): ...@@ -7550,7 +7550,7 @@ class UnboundMethodNode(ExprNode):
def generate_result_code(self, code): def generate_result_code(self, code):
class_cname = code.pyclass_stack[-1].classobj.result() class_cname = code.pyclass_stack[-1].classobj.result()
code.putln( code.putln(
"%s = PyMethod_New(%s, 0, %s); %s" % ( "%s = __Pyx_PyMethod_New(%s, 0, %s); %s" % (
self.result(), self.result(),
self.function.py_result(), self.function.py_result(),
class_cname, class_cname,
......
...@@ -545,13 +545,12 @@ static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObj ...@@ -545,13 +545,12 @@ static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObj
if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) { if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) {
if (type == NULL) if (type == NULL)
type = (PyObject *)(Py_TYPE(obj)); type = (PyObject *)(Py_TYPE(obj));
return PyMethod_New(func, return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type)));
type, (PyObject *)(Py_TYPE(type)));
} }
if (obj == Py_None) if (obj == Py_None)
obj = NULL; obj = NULL;
return PyMethod_New(func, obj, type); return __Pyx_PyMethod_New(func, obj, type);
} }
static PyObject* static PyObject*
......
...@@ -62,9 +62,6 @@ ...@@ -62,9 +62,6 @@
#if PY_MAJOR_VERSION >= 3 #if PY_MAJOR_VERSION >= 3
#define Py_TPFLAGS_CHECKTYPES 0 #define Py_TPFLAGS_CHECKTYPES 0
#define Py_TPFLAGS_HAVE_INDEX 0 #define Py_TPFLAGS_HAVE_INDEX 0
#endif
#if PY_MAJOR_VERSION >= 3
#define Py_TPFLAGS_HAVE_NEWBUFFER 0 #define Py_TPFLAGS_HAVE_NEWBUFFER 0
#endif #endif
...@@ -158,6 +155,12 @@ ...@@ -158,6 +155,12 @@
#define PyBoolObject PyLongObject #define PyBoolObject PyLongObject
#endif #endif
#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
#ifndef PyUnicode_InternFromString
#define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
#endif
#endif
#if PY_VERSION_HEX < 0x030200A4 #if PY_VERSION_HEX < 0x030200A4
typedef long Py_hash_t; typedef long Py_hash_t;
#define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_FromHash_t PyInt_FromLong
...@@ -168,7 +171,13 @@ ...@@ -168,7 +171,13 @@
#endif #endif
#if PY_MAJOR_VERSION >= 3 #if PY_MAJOR_VERSION >= 3
#define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
#ifndef PyMethod_New
/* for backwards compatibility only, but PyPy redefines PyMethod_New unconditionally */
#define PyMethod_New(func, self, klass) __Pyx_PyMethod_New(func, self, klass)
#endif
#else
#define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
#endif #endif
/* inline attribute */ /* inline attribute */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment