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
Kirill Smelkov
cython
Commits
924177f7
Commit
924177f7
authored
4 years ago
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify classmethod() code in Py3 where "PyMethodDescr_Type" is directly available.
parent
7ee7a39c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
Cython/Utility/CythonFunction.c
Cython/Utility/CythonFunction.c
+5
-1
No files found.
Cython/Utility/CythonFunction.c
View file @
924177f7
...
...
@@ -1459,7 +1459,8 @@ static PyObject* __Pyx_Method_ClassMethod(PyObject *method) {
// special C-API function only in Pyston and PyPy >= 5.9
if
(
PyMethodDescr_Check
(
method
))
#else
// It appears that PyMethodDescr_Type is not exposed anywhere in the CPython C-API
#if PY_MAJOR_VERSION == 2
// PyMethodDescr_Type is not exposed in the CPython C-API in Py2.
static
PyTypeObject
*
methoddescr_type
=
NULL
;
if
(
unlikely
(
methoddescr_type
==
NULL
))
{
PyObject
*
meth
=
PyObject_GetAttrString
((
PyObject
*
)
&
PyList_Type
,
"append"
);
...
...
@@ -1467,6 +1468,9 @@ static PyObject* __Pyx_Method_ClassMethod(PyObject *method) {
methoddescr_type
=
Py_TYPE
(
meth
);
Py_DECREF
(
meth
);
}
#else
PyTypeObject
*
methoddescr_type
=
&
PyMethodDescr_Type
;
#endif
if
(
__Pyx_TypeCheck
(
method
,
methoddescr_type
))
#endif
{
...
...
This diff is collapsed.
Click to expand it.
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