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
d798137c
Commit
d798137c
authored
Aug 08, 2014
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix Py3.5 support: PyCFunction is now weak referencible itself, need to remove it from CyFunction
parent
99f2d9ca
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
3 deletions
+15
-3
Cython/Utility/CythonFunction.c
Cython/Utility/CythonFunction.c
+15
-3
No files found.
Cython/Utility/CythonFunction.c
View file @
d798137c
...
@@ -21,8 +21,10 @@
...
@@ -21,8 +21,10 @@
typedef
struct
{
typedef
struct
{
PyCFunctionObject
func
;
PyCFunctionObject
func
;
PyObject
*
func_dict
;
#if PY_VERSION_HEX < 0x030500A0
PyObject
*
func_weakreflist
;
PyObject
*
func_weakreflist
;
#endif
PyObject
*
func_dict
;
PyObject
*
func_name
;
PyObject
*
func_name
;
PyObject
*
func_qualname
;
PyObject
*
func_qualname
;
PyObject
*
func_doc
;
PyObject
*
func_doc
;
...
@@ -73,6 +75,12 @@ static int __Pyx_CyFunction_init(void);
...
@@ -73,6 +75,12 @@ static int __Pyx_CyFunction_init(void);
//@requires: CommonTypes.c::FetchCommonType
//@requires: CommonTypes.c::FetchCommonType
////@requires: ObjectHandling.c::PyObjectGetAttrStr
////@requires: ObjectHandling.c::PyObjectGetAttrStr
#if PY_VERSION_HEX < 0x030500A0
#define __Pyx_CyFunction_weakreflist(func) ((func)->func_weakreflist)
#else
#define __Pyx_CyFunction_weakreflist(func) ((func)->func.m_weakreflist)
#endif
static
PyObject
*
static
PyObject
*
__Pyx_CyFunction_get_doc
(
__pyx_CyFunctionObject
*
op
,
CYTHON_UNUSED
void
*
closure
)
__Pyx_CyFunction_get_doc
(
__pyx_CyFunctionObject
*
op
,
CYTHON_UNUSED
void
*
closure
)
{
{
...
@@ -432,7 +440,7 @@ static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int f
...
@@ -432,7 +440,7 @@ static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int f
if
(
op
==
NULL
)
if
(
op
==
NULL
)
return
NULL
;
return
NULL
;
op
->
flags
=
flags
;
op
->
flags
=
flags
;
op
->
func_weakreflist
=
NULL
;
__Pyx_CyFunction_weakreflist
(
op
)
=
NULL
;
op
->
func
.
m_ml
=
ml
;
op
->
func
.
m_ml
=
ml
;
op
->
func
.
m_self
=
(
PyObject
*
)
op
;
op
->
func
.
m_self
=
(
PyObject
*
)
op
;
Py_XINCREF
(
closure
);
Py_XINCREF
(
closure
);
...
@@ -493,7 +501,7 @@ __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
...
@@ -493,7 +501,7 @@ __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
static
void
__Pyx_CyFunction_dealloc
(
__pyx_CyFunctionObject
*
m
)
static
void
__Pyx_CyFunction_dealloc
(
__pyx_CyFunctionObject
*
m
)
{
{
PyObject_GC_UnTrack
(
m
);
PyObject_GC_UnTrack
(
m
);
if
(
m
->
func_weakreflist
!=
NULL
)
if
(
__Pyx_CyFunction_weakreflist
(
m
)
!=
NULL
)
PyObject_ClearWeakRefs
((
PyObject
*
)
m
);
PyObject_ClearWeakRefs
((
PyObject
*
)
m
);
__Pyx_CyFunction_clear
(
m
);
__Pyx_CyFunction_clear
(
m
);
PyObject_GC_Del
(
m
);
PyObject_GC_Del
(
m
);
...
@@ -641,7 +649,11 @@ static PyTypeObject __pyx_CyFunctionType_type = {
...
@@ -641,7 +649,11 @@ static PyTypeObject __pyx_CyFunctionType_type = {
(
traverseproc
)
__Pyx_CyFunction_traverse
,
/*tp_traverse*/
(
traverseproc
)
__Pyx_CyFunction_traverse
,
/*tp_traverse*/
(
inquiry
)
__Pyx_CyFunction_clear
,
/*tp_clear*/
(
inquiry
)
__Pyx_CyFunction_clear
,
/*tp_clear*/
0
,
/*tp_richcompare*/
0
,
/*tp_richcompare*/
#if PY_VERSION_HEX < 0x030500A0
offsetof
(
__pyx_CyFunctionObject
,
func_weakreflist
),
/*tp_weaklistoffset*/
offsetof
(
__pyx_CyFunctionObject
,
func_weakreflist
),
/*tp_weaklistoffset*/
#else
offsetof
(
PyCFunctionObject
,
m_weakreflist
),
/*tp_weaklistoffset*/
#endif
0
,
/*tp_iter*/
0
,
/*tp_iter*/
0
,
/*tp_iternext*/
0
,
/*tp_iternext*/
__pyx_CyFunction_methods
,
/*tp_methods*/
__pyx_CyFunction_methods
,
/*tp_methods*/
...
...
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