@@ -61,7 +61,7 @@ typedef enum {
61
61
PyObject_HEAD \
62
62
PyObject *prefix##_loop; \
63
63
PyObject *prefix##_callback0; \
64
- PyContext *prefix##_context0; \
64
+ PyObject *prefix##_context0; \
65
65
PyObject *prefix##_callbacks; \
66
66
PyObject *prefix##_exception; \
67
67
PyObject *prefix##_result; \
@@ -81,7 +81,7 @@ typedef struct {
81
81
PyObject * task_fut_waiter ;
82
82
PyObject * task_coro ;
83
83
PyObject * task_name ;
84
- PyContext * task_context ;
84
+ PyObject * task_context ;
85
85
int task_must_cancel ;
86
86
int task_log_destroy_pending ;
87
87
} TaskObj ;
@@ -340,7 +340,7 @@ get_event_loop(void)
340
340
341
341
342
342
static int
343
- call_soon (PyObject * loop , PyObject * func , PyObject * arg , PyContext * ctx )
343
+ call_soon (PyObject * loop , PyObject * func , PyObject * arg , PyObject * ctx )
344
344
{
345
345
PyObject * handle ;
346
346
PyObject * stack [3 ];
@@ -451,7 +451,7 @@ future_schedule_callbacks(FutureObj *fut)
451
451
PyObject * cb = PyTuple_GET_ITEM (cb_tup , 0 );
452
452
PyObject * ctx = PyTuple_GET_ITEM (cb_tup , 1 );
453
453
454
- if (call_soon (fut -> fut_loop , cb , (PyObject * )fut , ( PyContext * ) ctx )) {
454
+ if (call_soon (fut -> fut_loop , cb , (PyObject * )fut , ctx )) {
455
455
/* If an error occurs in pure-Python implementation,
456
456
all callbacks are cleared. */
457
457
Py_CLEAR (fut -> fut_callbacks );
@@ -619,7 +619,7 @@ future_get_result(FutureObj *fut, PyObject **result)
619
619
}
620
620
621
621
static PyObject *
622
- future_add_done_callback (FutureObj * fut , PyObject * arg , PyContext * ctx )
622
+ future_add_done_callback (FutureObj * fut , PyObject * arg , PyObject * ctx )
623
623
{
624
624
if (!future_is_alive (fut )) {
625
625
PyErr_SetString (PyExc_RuntimeError , "uninitialized Future object" );
@@ -906,16 +906,15 @@ _asyncio_Future_add_done_callback_impl(FutureObj *self, PyObject *fn,
906
906
/*[clinic end generated code: output=7ce635bbc9554c1e input=15ab0693a96e9533]*/
907
907
{
908
908
if (context == NULL ) {
909
- context = ( PyObject * ) PyContext_CopyCurrent ();
909
+ context = PyContext_CopyCurrent ();
910
910
if (context == NULL ) {
911
911
return NULL ;
912
912
}
913
- PyObject * res = future_add_done_callback (
914
- self , fn , (PyContext * )context );
913
+ PyObject * res = future_add_done_callback (self , fn , context );
915
914
Py_DECREF (context );
916
915
return res ;
917
916
}
918
- return future_add_done_callback (self , fn , ( PyContext * ) context );
917
+ return future_add_done_callback (self , fn , context );
919
918
}
920
919
921
920
/*[clinic input]
0 commit comments