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
7cb03b17
Commit
7cb03b17
authored
Sep 28, 2015
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '0.23.x'
parents
8a242c27
f0eaa48e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
13 deletions
+37
-13
CHANGES.rst
CHANGES.rst
+7
-0
Cython/Utility/Coroutine.c
Cython/Utility/Coroutine.c
+30
-13
No files found.
CHANGES.rst
View file @
7cb03b17
...
@@ -71,6 +71,13 @@ Bugs fixed
...
@@ -71,6 +71,13 @@ Bugs fixed
* Large folded or inserted integer constants could use too small C
* Large folded or inserted integer constants could use too small C
integer types and thus trigger a value wrap-around.
integer types and thus trigger a value wrap-around.
Other changes
-------------
* The coroutine and generator types of Cython now also register directly
with the ``Coroutine`` and ``Generator`` ABCs in the ``backports_abc``
module if it can be imported.
0.23.2 (2015-09-11)
0.23.2 (2015-09-11)
===================
===================
...
...
Cython/Utility/Coroutine.c
View file @
7cb03b17
...
@@ -1490,13 +1490,32 @@ ignore:
...
@@ -1490,13 +1490,32 @@ ignore:
//////////////////// PatchGeneratorABC.proto ////////////////////
//////////////////// PatchGeneratorABC.proto ////////////////////
//
patch 'collections.abc' if it lacks generator support
//
register with Generator/Coroutine ABCs in 'collections.abc'
// see https://bugs.python.org/issue24018
// see https://bugs.python.org/issue24018
static
int
__Pyx_patch_abc
(
void
);
/*proto*/
static
int
__Pyx_patch_abc
(
void
);
/*proto*/
//////////////////// PatchGeneratorABC ////////////////////
//////////////////// PatchGeneratorABC ////////////////////
//@requires: PatchModuleWithCoroutine
//@requires: PatchModuleWithCoroutine
#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
static
PyObject
*
__Pyx_patch_abc_module
(
PyObject
*
module
);
/*proto*/
static
PyObject
*
__Pyx_patch_abc_module
(
PyObject
*
module
)
{
module
=
__Pyx_Coroutine_patch_module
(
module
,
CSTRING
(
"""\
if _cython_generator_type is not None:
try: Generator = _module.Generator
except AttributeError: pass
else: Generator.register(_cython_generator_type)
if _cython_coroutine_type is not None:
try: Coroutine = _module.Coroutine
except AttributeError: pass
else: Coroutine.register(_cython_coroutine_type)
"""
)
);
return
module
;
}
#endif
static
int
__Pyx_patch_abc
(
void
)
{
static
int
__Pyx_patch_abc
(
void
)
{
#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
static
int
abc_patched
=
0
;
static
int
abc_patched
=
0
;
...
@@ -1512,23 +1531,21 @@ static int __Pyx_patch_abc(void) {
...
@@ -1512,23 +1531,21 @@ static int __Pyx_patch_abc(void) {
return
-
1
;
return
-
1
;
}
}
}
else
{
}
else
{
module
=
__Pyx_Coroutine_patch_module
(
module
=
__Pyx_patch_abc_module
(
module
);
module
,
CSTRING
(
"""\
if _cython_generator_type is not None:
try: Generator = _module.Generator
except AttributeError: pass
else: Generator.register(_cython_generator_type)
if _cython_coroutine_type is not None:
try: Coroutine = _module.Coroutine
except AttributeError: pass
else: Coroutine.register(_cython_coroutine_type)
"""
)
);
abc_patched
=
1
;
abc_patched
=
1
;
if
(
unlikely
(
!
module
))
if
(
unlikely
(
!
module
))
return
-
1
;
return
-
1
;
Py_DECREF
(
module
);
Py_DECREF
(
module
);
}
}
// also register with "backports_abc" module if available, just in case
module
=
PyImport_ImportModule
(
"backports_abc"
);
if
(
module
)
{
module
=
__Pyx_patch_abc_module
(
module
);
Py_XDECREF
(
module
);
}
if
(
!
module
)
{
PyErr_Clear
();
}
}
}
#else
#else
// avoid "unused" warning for __Pyx_Coroutine_patch_module()
// avoid "unused" warning for __Pyx_Coroutine_patch_module()
...
...
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