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
0c815f07
Commit
0c815f07
authored
Sep 04, 2016
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix AsyncGen type initialisation and instantiation
parent
16d9b135
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
8 deletions
+30
-8
Cython/Utility/AsyncGen.c
Cython/Utility/AsyncGen.c
+19
-6
Cython/Utility/Coroutine.c
Cython/Utility/Coroutine.c
+11
-2
No files found.
Cython/Utility/AsyncGen.c
View file @
0c815f07
...
...
@@ -19,8 +19,18 @@ static PyTypeObject *__pyx__PyAsyncGenAThrowType = 0;
static
PyTypeObject
*
__pyx_AsyncGenType
=
0
;
#define __Pyx_AsyncGen_CheckExact(obj) (Py_TYPE(obj) == __pyx_AsyncGenType)
#define __Pyx_AsyncGen_New(body, closure, name, qualname, module_name) \
__Pyx__Coroutine_New(__pyx_AsyncGenType, body, closure, name, qualname, module_name)
static
__pyx_CoroutineObject
*
__Pyx_AsyncGen_New
(
__pyx_coroutine_body_t
body
,
PyObject
*
closure
,
PyObject
*
name
,
PyObject
*
qualname
,
PyObject
*
module_name
)
{
__pyx_AsyncGenObject
*
gen
=
PyObject_GC_New
(
__pyx_AsyncGenObject
,
__pyx_AsyncGenType
);
if
(
unlikely
(
!
gen
))
return
NULL
;
gen
->
ag_finalizer
=
NULL
;
gen
->
ag_hooks_inited
=
0
;
gen
->
ag_closed
=
0
;
return
__Pyx__Coroutine_NewInit
((
__pyx_CoroutineObject
*
)
gen
,
body
,
closure
,
name
,
qualname
,
module_name
);
}
static
int
__pyx_AsyncGen_init
(
void
);
...
...
@@ -239,7 +249,7 @@ __Pyx_async_gen_athrow(__pyx_AsyncGenObject *o, PyObject *args)
static
PyGetSetDef
__Pyx_async_gen_getsetlist
[]
=
{
{
"__name__"
,
(
getter
)
__Pyx_Coroutine_get_name
,
(
setter
)
__Pyx_Coroutine_set_name
,
PyDoc_STR
(
"name of the async generator"
),
0
},
{
"__qualname__"
,
(
getter
)
__Pyx_Coroutine_get_qualname
,
(
setter
)
__Pyx_Coroutine_
g
et_qualname
,
{
"__qualname__"
,
(
getter
)
__Pyx_Coroutine_get_qualname
,
(
setter
)
__Pyx_Coroutine_
s
et_qualname
,
PyDoc_STR
(
"qualified name of the async generator"
),
0
},
//REMOVED: {"ag_await", (getter)coro_get_cr_await, NULL,
//REMOVED: PyDoc_STR("object being awaited on, or None")},
...
...
@@ -527,7 +537,7 @@ PyTypeObject __pyx__PyAsyncGenASendType_type = {
0
,
/* tp_hash */
0
,
/* tp_call */
0
,
/* tp_str */
PyObject_GenericGetAttr
,
/* tp_getattro */
0
,
/* tp_getattro */
0
,
/* tp_setattro */
0
,
/* tp_as_buffer */
Py_TPFLAGS_DEFAULT
,
/* tp_flags */
...
...
@@ -626,7 +636,7 @@ PyTypeObject __pyx__PyAsyncGenWrappedValueType_type = {
0
,
/* tp_hash */
0
,
/* tp_call */
0
,
/* tp_str */
PyObject_GenericGetAttr
,
/* tp_getattro */
0
,
/* tp_getattro */
0
,
/* tp_setattro */
0
,
/* tp_as_buffer */
Py_TPFLAGS_DEFAULT
,
/* tp_flags */
...
...
@@ -874,7 +884,7 @@ PyTypeObject __pyx__PyAsyncGenAThrowType_type = {
0
,
/* tp_hash */
0
,
/* tp_call */
0
,
/* tp_str */
PyObject_GenericGetAttr
,
/* tp_getattro */
0
,
/* tp_getattro */
0
,
/* tp_setattro */
0
,
/* tp_as_buffer */
Py_TPFLAGS_DEFAULT
,
/* tp_flags */
...
...
@@ -938,6 +948,9 @@ __Pyx_async_gen_athrow_new(__pyx_AsyncGenObject *gen, PyObject *args)
static
int
__pyx_AsyncGen_init
(
void
)
{
// on Windows, C-API functions can't be used in slots statically
__pyx_AsyncGenType_type
.
tp_getattro
=
PyObject_GenericGetAttr
;
__pyx__PyAsyncGenWrappedValueType_type
.
tp_getattro
=
PyObject_GenericGetAttr
;
__pyx__PyAsyncGenAThrowType_type
.
tp_getattro
=
PyObject_GenericGetAttr
;
__pyx__PyAsyncGenASendType_type
.
tp_getattro
=
PyObject_GenericGetAttr
;
__pyx_AsyncGenType
=
__Pyx_FetchCommonType
(
&
__pyx_AsyncGenType_type
);
if
(
unlikely
(
!
__pyx_AsyncGenType
))
...
...
Cython/Utility/Coroutine.c
View file @
0c815f07
...
...
@@ -350,6 +350,11 @@ typedef struct {
static
__pyx_CoroutineObject
*
__Pyx__Coroutine_New
(
PyTypeObject
*
type
,
__pyx_coroutine_body_t
body
,
PyObject
*
closure
,
PyObject
*
name
,
PyObject
*
qualname
,
PyObject
*
module_name
);
/*proto*/
static
__pyx_CoroutineObject
*
__Pyx__Coroutine_NewInit
(
__pyx_CoroutineObject
*
gen
,
__pyx_coroutine_body_t
body
,
PyObject
*
closure
,
PyObject
*
name
,
PyObject
*
qualname
,
PyObject
*
module_name
);
/*proto*/
static
int
__Pyx_Coroutine_clear
(
PyObject
*
self
);
/*proto*/
#if 1 || PY_VERSION_HEX < 0x030300B0
...
...
@@ -1074,10 +1079,14 @@ static __pyx_CoroutineObject *__Pyx__Coroutine_New(
PyTypeObject
*
type
,
__pyx_coroutine_body_t
body
,
PyObject
*
closure
,
PyObject
*
name
,
PyObject
*
qualname
,
PyObject
*
module_name
)
{
__pyx_CoroutineObject
*
gen
=
PyObject_GC_New
(
__pyx_CoroutineObject
,
type
);
if
(
gen
==
NULL
)
if
(
unlikely
(
!
gen
))
return
NULL
;
return
__Pyx__Coroutine_NewInit
(
gen
,
body
,
closure
,
name
,
qualname
,
module_name
);
}
static
__pyx_CoroutineObject
*
__Pyx__Coroutine_NewInit
(
__pyx_CoroutineObject
*
gen
,
__pyx_coroutine_body_t
body
,
PyObject
*
closure
,
PyObject
*
name
,
PyObject
*
qualname
,
PyObject
*
module_name
)
{
gen
->
body
=
body
;
gen
->
closure
=
closure
;
Py_XINCREF
(
closure
);
...
...
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