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
498371be
Commit
498371be
authored
May 25, 2015
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix up async iter helpers in latest Py3.5
parent
a8bc839c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
15 deletions
+12
-15
Cython/Utility/Coroutine.c
Cython/Utility/Coroutine.c
+12
-15
No files found.
Cython/Utility/Coroutine.c
View file @
498371be
...
@@ -94,21 +94,18 @@ static CYTHON_INLINE PyObject *__Pyx_Coroutine_GetAwaitableIter(PyObject *o) {
...
@@ -94,21 +94,18 @@ static CYTHON_INLINE PyObject *__Pyx_Coroutine_GetAwaitableIter(PyObject *o) {
return
__Pyx__Coroutine_GetAwaitableIter
(
o
);
return
__Pyx__Coroutine_GetAwaitableIter
(
o
);
}
}
//
copied and
adapted from genobject.c in Py3.5
// adapted from genobject.c in Py3.5
static
PyObject
*
__Pyx__Coroutine_GetAwaitableIter
(
PyObject
*
o
)
{
static
PyObject
*
__Pyx__Coroutine_GetAwaitableIter
(
PyObject
*
o
bj
)
{
PyObject
*
res
;
PyObject
*
res
;
#if PY_VERSION_HEX >= 0x030500B1
#if PY_VERSION_HEX >= 0x030500B1
unaryfunc
getter
=
NULL
;
PyAsyncMethods
*
am
=
Py_TYPE
(
obj
)
->
tp_as_async
;
PyTypeObject
*
ot
;
if
(
likely
(
am
&&
am
->
am_await
))
{
res
=
(
*
am
->
am_await
)(
obj
);
ot
=
Py_TYPE
(
o
);
}
else
{
if
(
likely
(
ot
->
tp_as_async
))
{
goto
slot_error
;
getter
=
(
unaryfunc
)
ot
->
tp_as_async
->
am_await
;
}
}
if
(
unlikely
(
getter
))
goto
slot_error
;
res
=
(
*
getter
)(
o
);
#else
#else
PyObject
*
method
=
__Pyx_PyObject_GetAttrStr
(
o
,
PYIDENT
(
"__await__"
));
PyObject
*
method
=
__Pyx_PyObject_GetAttrStr
(
o
bj
,
PYIDENT
(
"__await__"
));
if
(
unlikely
(
!
method
))
goto
slot_error
;
if
(
unlikely
(
!
method
))
goto
slot_error
;
#if CYTHON_COMPILING_IN_CPYTHON
#if CYTHON_COMPILING_IN_CPYTHON
if
(
likely
(
PyMethod_Check
(
method
)))
{
if
(
likely
(
PyMethod_Check
(
method
)))
{
...
@@ -149,7 +146,7 @@ static PyObject *__Pyx__Coroutine_GetAwaitableIter(PyObject *o) {
...
@@ -149,7 +146,7 @@ static PyObject *__Pyx__Coroutine_GetAwaitableIter(PyObject *o) {
slot_error:
slot_error:
PyErr_Format
(
PyExc_TypeError
,
PyErr_Format
(
PyExc_TypeError
,
"object %.100s can't be used in 'await' expression"
,
"object %.100s can't be used in 'await' expression"
,
Py_TYPE
(
o
)
->
tp_name
);
Py_TYPE
(
o
bj
)
->
tp_name
);
bad:
bad:
return
NULL
;
return
NULL
;
}
}
...
@@ -985,11 +982,11 @@ static void __Pyx_Coroutine_check_and_dealloc(PyObject *self) {
...
@@ -985,11 +982,11 @@ static void __Pyx_Coroutine_check_and_dealloc(PyObject *self) {
}
}
#if PY_VERSION_HEX >= 0x030500B1
#if PY_VERSION_HEX >= 0x030500B1
static
PyAsyncMethods
__pyx_Coroutine_as_async
{
static
PyAsyncMethods
__pyx_Coroutine_as_async
=
{
0
,
/*am_await*/
0
,
/*am_await*/
0
,
/*am_aiter*/
0
,
/*am_aiter*/
0
,
/*am_anext*/
0
,
/*am_anext*/
}
}
;
#endif
#endif
static
PyTypeObject
__pyx_CoroutineType_type
=
{
static
PyTypeObject
__pyx_CoroutineType_type
=
{
...
@@ -1002,7 +999,7 @@ static PyTypeObject __pyx_CoroutineType_type = {
...
@@ -1002,7 +999,7 @@ static PyTypeObject __pyx_CoroutineType_type = {
0
,
/*tp_getattr*/
0
,
/*tp_getattr*/
0
,
/*tp_setattr*/
0
,
/*tp_setattr*/
#if PY_VERSION_HEX >= 0x030500B1
#if PY_VERSION_HEX >= 0x030500B1
__pyx_Coroutine_as_async
,
/*tp_as_async*/
&
__pyx_Coroutine_as_async
,
/*tp_as_async*/
#else
#else
0
,
/*tp_reserved resp. tp_compare*/
0
,
/*tp_reserved resp. tp_compare*/
#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