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
4261a694
Commit
4261a694
authored
Aug 03, 2013
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use tp_finalize instead of tp_del for Cython generators
parent
631086f9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
1 deletion
+9
-1
Cython/Utility/Generator.c
Cython/Utility/Generator.c
+9
-1
No files found.
Cython/Utility/Generator.c
View file @
4261a694
...
@@ -482,9 +482,11 @@ static void __Pyx_Generator_del(PyObject *self) {
...
@@ -482,9 +482,11 @@ static void __Pyx_Generator_del(PyObject *self) {
if
(
gen
->
resume_label
<=
0
)
if
(
gen
->
resume_label
<=
0
)
return
;
return
;
#if PY_VERSION_HEX < 0x03040a00
/* Temporarily resurrect the object. */
/* Temporarily resurrect the object. */
assert
(
self
->
ob_refcnt
==
0
);
assert
(
self
->
ob_refcnt
==
0
);
self
->
ob_refcnt
=
1
;
self
->
ob_refcnt
=
1
;
#endif
/* Save the current exception, if any. */
/* Save the current exception, if any. */
__Pyx_ErrFetch
(
&
error_type
,
&
error_value
,
&
error_traceback
);
__Pyx_ErrFetch
(
&
error_type
,
&
error_value
,
&
error_traceback
);
...
@@ -499,6 +501,7 @@ static void __Pyx_Generator_del(PyObject *self) {
...
@@ -499,6 +501,7 @@ static void __Pyx_Generator_del(PyObject *self) {
/* Restore the saved exception. */
/* Restore the saved exception. */
__Pyx_ErrRestore
(
error_type
,
error_value
,
error_traceback
);
__Pyx_ErrRestore
(
error_type
,
error_value
,
error_traceback
);
#if PY_VERSION_HEX < 0x03040a00
/* Undo the temporary resurrection; can't use DECREF here, it would
/* Undo the temporary resurrection; can't use DECREF here, it would
* cause a recursive call.
* cause a recursive call.
*/
*/
...
@@ -532,6 +535,7 @@ static void __Pyx_Generator_del(PyObject *self) {
...
@@ -532,6 +535,7 @@ static void __Pyx_Generator_del(PyObject *self) {
--
Py_TYPE
(
self
)
->
tp_frees
;
--
Py_TYPE
(
self
)
->
tp_frees
;
--
Py_TYPE
(
self
)
->
tp_allocs
;
--
Py_TYPE
(
self
)
->
tp_allocs
;
#endif
#endif
#endif
}
}
static
PyMemberDef
__pyx_Generator_memberlist
[]
=
{
static
PyMemberDef
__pyx_Generator_memberlist
[]
=
{
...
@@ -604,12 +608,16 @@ static PyTypeObject __pyx_GeneratorType_type = {
...
@@ -604,12 +608,16 @@ static PyTypeObject __pyx_GeneratorType_type = {
0
,
/*tp_cache*/
0
,
/*tp_cache*/
0
,
/*tp_subclasses*/
0
,
/*tp_subclasses*/
0
,
/*tp_weaklist*/
0
,
/*tp_weaklist*/
#if PY_VERSION_HEX >= 0x03040a00
0
,
#else
__Pyx_Generator_del
,
/*tp_del*/
__Pyx_Generator_del
,
/*tp_del*/
#endif
#if PY_VERSION_HEX >= 0x02060000
#if PY_VERSION_HEX >= 0x02060000
0
,
/*tp_version_tag*/
0
,
/*tp_version_tag*/
#endif
#endif
#if PY_VERSION_HEX >= 0x03040a00
#if PY_VERSION_HEX >= 0x03040a00
0
,
/*tp_finalize*/
__Pyx_Generator_del
,
/*tp_finalize*/
#endif
#endif
};
};
...
...
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