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
4f5e5a30
Commit
4f5e5a30
authored
Jul 08, 2015
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
work around C-API deficiencies in PyPy
parent
659b7413
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
3 deletions
+12
-3
Cython/Utility/Coroutine.c
Cython/Utility/Coroutine.c
+12
-3
No files found.
Cython/Utility/Coroutine.c
View file @
4f5e5a30
...
...
@@ -1003,10 +1003,12 @@ static PyObject *__Pyx_CoroutineAwait_self(PyObject *self) {
return
self
;
}
#if CYTHON_COMPILING_IN_CPYTHON
static
PyObject
*
__Pyx_CoroutineAwait_no_new
(
CYTHON_UNUSED
PyTypeObject
*
type
,
CYTHON_UNUSED
PyObject
*
args
,
CYTHON_UNUSED
PyObject
*
kwargs
)
{
PyErr_SetString
(
PyExc_TypeError
,
"cannot instantiate type, use 'await coroutine' instead"
);
return
NULL
;
}
#endif
static
PyMethodDef
__pyx_CoroutineAwait_methods
[]
=
{
{
"send"
,
(
PyCFunction
)
__Pyx_CoroutineAwait_Send
,
METH_O
,
...
...
@@ -1056,7 +1058,11 @@ static PyTypeObject __pyx_CoroutineAwaitType_type = {
0
,
/*tp_dictoffset*/
0
,
/*tp_init*/
0
,
/*tp_alloc*/
#if CYTHON_COMPILING_IN_CPYTHON
__Pyx_CoroutineAwait_no_new
,
/*tp_new*/
#else
0
,
/*tp_new*/
#endif
0
,
/*tp_free*/
0
,
/*tp_is_gc*/
0
,
/*tp_bases*/
...
...
@@ -1075,7 +1081,8 @@ static CYTHON_INLINE PyObject *__Pyx__Coroutine_await(PyObject *coroutine) {
#if CYTHON_COMPILING_IN_CPYTHON
__pyx_CoroutineAwaitObject
*
await
=
PyObject_GC_New
(
__pyx_CoroutineAwaitObject
,
__pyx_CoroutineAwaitType
);
#else
__pyx_CoroutineAwaitObject
*
await
=
__pyx_CoroutineAwaitType
->
tp_alloc
(
__pyx_CoroutineAwaitType
);
__pyx_CoroutineAwaitObject
*
await
=
(
__pyx_CoroutineAwaitObject
*
)
__pyx_CoroutineAwaitType
->
tp_new
(
__pyx_CoroutineAwaitType
,
__pyx_empty_tuple
,
NULL
);
#endif
if
(
unlikely
(
!
await
))
return
NULL
;
Py_INCREF
(
coroutine
);
...
...
@@ -1102,10 +1109,12 @@ static void __Pyx_Coroutine_check_and_dealloc(PyObject *self) {
PyErr_WarnFormat
(
PyExc_RuntimeWarning
,
1
,
"coroutine '%.50S' was never awaited"
,
gen
->
gi_qualname
);
#else
PyObject
*
msg
;
char
*
c
name
,
*
c
msg
;
char
*
cmsg
;
#if CYTHON_COMPILING_IN_PYPY
msg
=
NULL
;
cmsg
=
(
char
*
)
"coroutine was never awaited"
;
#else
char
*
cname
;
PyObject
*
qualname
;
#if PY_MAJOR_VERSION >= 3
qualname
=
PyUnicode_AsUTF8String
(
gen
->
gi_qualname
);
...
...
@@ -1126,7 +1135,6 @@ static void __Pyx_Coroutine_check_and_dealloc(PyObject *self) {
#if PY_MAJOR_VERSION >= 3
Py_XDECREF
(
qualname
);
#endif
#endif
if
(
unlikely
(
!
msg
))
{
PyErr_Clear
();
...
...
@@ -1138,6 +1146,7 @@ static void __Pyx_Coroutine_check_and_dealloc(PyObject *self) {
cmsg
=
PyString_AS_STRING
(
msg
);
#endif
}
#endif
if
(
unlikely
(
PyErr_WarnEx
(
PyExc_RuntimeWarning
,
cmsg
,
1
)
<
0
))
PyErr_WriteUnraisable
(
self
);
Py_XDECREF
(
msg
);
...
...
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