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
b37607f4
Commit
b37607f4
authored
Nov 27, 2020
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix usage of undefined C-API function "_PyGen_Send" in Py3.10.
parent
65b37855
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
3 deletions
+29
-3
Cython/Utility/Coroutine.c
Cython/Utility/Coroutine.c
+29
-3
No files found.
Cython/Utility/Coroutine.c
View file @
b37607f4
...
@@ -788,6 +788,32 @@ PyObject *__Pyx_Coroutine_MethodReturn(CYTHON_UNUSED PyObject* gen, PyObject *re
...
@@ -788,6 +788,32 @@ PyObject *__Pyx_Coroutine_MethodReturn(CYTHON_UNUSED PyObject* gen, PyObject *re
return
retval
;
return
retval
;
}
}
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
static
CYTHON_INLINE
PyObject
*
__Pyx_PyGen_Send
(
PyGenObject
*
gen
,
PyObject
*
arg
)
{
#if PY_VERSION_HEX < 0x030A00A1
return
_PyGen_Send
(
gen
,
arg
);
#else
PyObject
*
result
;
// PyGen_Send() asserts non-NULL arg
if
(
PyGen_Send
(
gen
,
arg
?
arg
:
Py_None
,
&
result
)
==
PYGEN_RETURN
)
{
if
(
PyAsyncGen_CheckExact
(
gen
))
{
assert
(
result
==
Py_None
);
PyErr_SetNone
(
PyExc_StopAsyncIteration
);
}
else
if
(
result
==
Py_None
)
{
PyErr_SetNone
(
PyExc_StopIteration
);
}
else
{
_PyGen_SetStopIterationValue
(
result
);
}
Py_CLEAR
(
result
);
}
return
result
;
#endif
}
#endif
static
CYTHON_INLINE
static
CYTHON_INLINE
PyObject
*
__Pyx_Coroutine_FinishDelegation
(
__pyx_CoroutineObject
*
gen
)
{
PyObject
*
__Pyx_Coroutine_FinishDelegation
(
__pyx_CoroutineObject
*
gen
)
{
PyObject
*
ret
;
PyObject
*
ret
;
...
@@ -829,13 +855,13 @@ static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value) {
...
@@ -829,13 +855,13 @@ static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value) {
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
// _PyGen_Send() is not exported before Py3.6
// _PyGen_Send() is not exported before Py3.6
if
(
PyGen_CheckExact
(
yf
))
{
if
(
PyGen_CheckExact
(
yf
))
{
ret
=
_PyGen_Send
((
PyGenObject
*
)
yf
,
value
==
Py_None
?
NULL
:
value
);
ret
=
_
_Pyx_
PyGen_Send
((
PyGenObject
*
)
yf
,
value
==
Py_None
?
NULL
:
value
);
}
else
}
else
#endif
#endif
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03050000 && defined(PyCoro_CheckExact) && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03050000 && defined(PyCoro_CheckExact) && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
// _PyGen_Send() is not exported before Py3.6
// _PyGen_Send() is not exported before Py3.6
if
(
PyCoro_CheckExact
(
yf
))
{
if
(
PyCoro_CheckExact
(
yf
))
{
ret
=
_PyGen_Send
((
PyGenObject
*
)
yf
,
value
==
Py_None
?
NULL
:
value
);
ret
=
_
_Pyx_
PyGen_Send
((
PyGenObject
*
)
yf
,
value
==
Py_None
?
NULL
:
value
);
}
else
}
else
#endif
#endif
{
{
...
@@ -931,7 +957,7 @@ static PyObject *__Pyx_Generator_Next(PyObject *self) {
...
@@ -931,7 +957,7 @@ static PyObject *__Pyx_Generator_Next(PyObject *self) {
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
// _PyGen_Send() is not exported before Py3.6
// _PyGen_Send() is not exported before Py3.6
if
(
PyGen_CheckExact
(
yf
))
{
if
(
PyGen_CheckExact
(
yf
))
{
ret
=
_PyGen_Send
((
PyGenObject
*
)
yf
,
NULL
);
ret
=
_
_Pyx_
PyGen_Send
((
PyGenObject
*
)
yf
,
NULL
);
}
else
}
else
#endif
#endif
#ifdef __Pyx_Coroutine_USED
#ifdef __Pyx_Coroutine_USED
...
...
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