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
37070f3d
Commit
37070f3d
authored
Jun 13, 2019
by
Jeroen Demeyer
Committed by
Stefan Behnel
Jun 13, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support Py_TPFLAGS_METHOD_DESCRIPTOR for Cython functions (GH-2998)
parent
7a2ae54b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
1 deletion
+6
-1
Cython/Utility/CythonFunction.c
Cython/Utility/CythonFunction.c
+3
-0
Cython/Utility/ObjectHandling.c
Cython/Utility/ObjectHandling.c
+3
-1
No files found.
Cython/Utility/CythonFunction.c
View file @
37070f3d
...
...
@@ -696,6 +696,9 @@ static PyTypeObject __pyx_CyFunctionType_type = {
0
,
/*tp_getattro*/
0
,
/*tp_setattro*/
0
,
/*tp_as_buffer*/
#ifdef Py_TPFLAGS_METHOD_DESCRIPTOR
Py_TPFLAGS_METHOD_DESCRIPTOR
|
#endif
Py_TPFLAGS_DEFAULT
|
Py_TPFLAGS_HAVE_GC
,
/*tp_flags*/
0
,
/*tp_doc*/
(
traverseproc
)
__Pyx_CyFunction_traverse
,
/*tp_traverse*/
...
...
Cython/Utility/ObjectHandling.c
View file @
37070f3d
...
...
@@ -1486,7 +1486,9 @@ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **me
if
(
likely
(
descr
!=
NULL
))
{
Py_INCREF
(
descr
);
// Repeating the condition below accommodates for MSVC's inability to test macros inside of macro expansions.
#if PY_MAJOR_VERSION >= 3
#ifdef Py_TPFLAGS_METHOD_DESCRIPTOR
if
(
PyType_HasFeature
(
Py_TYPE
(
descr
),
Py_TPFLAGS_METHOD_DESCRIPTOR
))
#elif PY_MAJOR_VERSION >= 3
#ifdef __Pyx_CyFunction_USED
if
(
likely
(
PyFunction_Check
(
descr
)
||
(
Py_TYPE
(
descr
)
==
&
PyMethodDescr_Type
)
||
__Pyx_CyFunction_Check
(
descr
)))
#else
...
...
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