Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Gwenaël Samain
cython
Commits
19d890ec
Commit
19d890ec
authored
Jul 18, 2017
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PyPy fix.
Don't use CPython PyMethodDescrObject.
parent
6880c0a0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
6 deletions
+22
-6
Cython/Utility/ExtensionTypes.c
Cython/Utility/ExtensionTypes.c
+22
-6
No files found.
Cython/Utility/ExtensionTypes.c
View file @
19d890ec
...
...
@@ -60,6 +60,26 @@ static int __Pyx_setup_reduce(PyObject* type_obj);
#define __Pyx_setup_reduce_GET_ATTR_OR_BAD(res, obj, name) res = PyObject_GetAttrString(obj, name); if (res == NULL) goto BAD;
static
int
__Pyx_setup_reduce_is_named
(
PyObject
*
meth
,
PyObject
*
name
)
{
int
ret
;
PyObject
*
name_attr
;
name_attr
=
PyObject_GetAttrString
(
meth
,
"__name__"
);
if
(
name_attr
)
{
ret
=
PyObject_RichCompareBool
(
name_attr
,
name
,
Py_EQ
);
}
else
{
ret
=
-
1
;
}
if
(
ret
<
0
)
{
PyErr_Clear
();
ret
=
0
;
}
Py_XDECREF
(
name_attr
);
return
ret
;
}
static
int
__Pyx_setup_reduce
(
PyObject
*
type_obj
)
{
int
ret
=
0
;
PyObject
*
builtin_object
=
NULL
;
...
...
@@ -82,18 +102,14 @@ static int __Pyx_setup_reduce(PyObject* type_obj) {
__Pyx_setup_reduce_GET_ATTR_OR_BAD
(
reduce_ex
,
type_obj
,
"__reduce_ex__"
);
if
(
reduce_ex
==
object_reduce_ex
)
{
__Pyx_setup_reduce_GET_ATTR_OR_BAD
(
reduce
,
type_obj
,
"__reduce__"
);
if
(
object_reduce
==
reduce
||
(
strcmp
(
reduce
->
ob_type
->
tp_name
,
"method_descriptor"
)
==
0
&&
strcmp
(((
PyMethodDescrObject
*
)
reduce
)
->
d_method
->
ml_name
,
"__reduce_cython__"
)
==
0
))
{
if
(
object_reduce
==
reduce
||
__Pyx_setup_reduce_is_named
(
reduce
,
PYIDENT
(
"__reduce_cython__"
)))
{
__Pyx_setup_reduce_GET_ATTR_OR_BAD
(
reduce_cython
,
type_obj
,
"__reduce_cython__"
);
ret
=
PyDict_SetItemString
(((
PyTypeObject
*
)
type_obj
)
->
tp_dict
,
"__reduce__"
,
reduce_cython
);
if
(
ret
<
0
)
goto
BAD
;
ret
=
PyDict_DelItemString
(((
PyTypeObject
*
)
type_obj
)
->
tp_dict
,
"__reduce_cython__"
);
if
(
ret
<
0
)
goto
BAD
;
setstate
=
PyObject_GetAttrString
(
type_obj
,
"__setstate__"
);
if
(
!
setstate
)
PyErr_Clear
();
if
(
!
setstate
||
(
strcmp
(
setstate
->
ob_type
->
tp_name
,
"method_descriptor"
)
==
0
&&
strcmp
(((
PyMethodDescrObject
*
)
setstate
)
->
d_method
->
ml_name
,
"__setstate_cython__"
)
==
0
))
{
if
(
!
setstate
||
__Pyx_setup_reduce_is_named
(
setstate
,
PYIDENT
(
"__setstate_cython__"
)))
{
__Pyx_setup_reduce_GET_ATTR_OR_BAD
(
setstate_cython
,
type_obj
,
"__setstate_cython__"
);
ret
=
PyDict_SetItemString
(((
PyTypeObject
*
)
type_obj
)
->
tp_dict
,
"__setstate__"
,
setstate_cython
);
if
(
ret
<
0
)
goto
BAD
;
ret
=
PyDict_DelItemString
(((
PyTypeObject
*
)
type_obj
)
->
tp_dict
,
"__setstate_cython__"
);
if
(
ret
<
0
)
goto
BAD
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment