@@ -61,7 +61,7 @@ typedef enum {
6161 PyObject_HEAD \
6262 PyObject *prefix##_loop; \
6363 PyObject *prefix##_callback0; \
64- PyContext *prefix##_context0; \
64+ PyObject *prefix##_context0; \
6565 PyObject *prefix##_callbacks; \
6666 PyObject *prefix##_exception; \
6767 PyObject *prefix##_result; \
@@ -81,7 +81,7 @@ typedef struct {
8181 PyObject * task_fut_waiter ;
8282 PyObject * task_coro ;
8383 PyObject * task_name ;
84- PyContext * task_context ;
84+ PyObject * task_context ;
8585 int task_must_cancel ;
8686 int task_log_destroy_pending ;
8787} TaskObj ;
@@ -340,7 +340,7 @@ get_event_loop(void)
340340
341341
342342static int
343- call_soon (PyObject * loop , PyObject * func , PyObject * arg , PyContext * ctx )
343+ call_soon (PyObject * loop , PyObject * func , PyObject * arg , PyObject * ctx )
344344{
345345 PyObject * handle ;
346346 PyObject * stack [3 ];
@@ -451,7 +451,7 @@ future_schedule_callbacks(FutureObj *fut)
451451 PyObject * cb = PyTuple_GET_ITEM (cb_tup , 0 );
452452 PyObject * ctx = PyTuple_GET_ITEM (cb_tup , 1 );
453453
454- if (call_soon (fut -> fut_loop , cb , (PyObject * )fut , ( PyContext * ) ctx )) {
454+ if (call_soon (fut -> fut_loop , cb , (PyObject * )fut , ctx )) {
455455 /* If an error occurs in pure-Python implementation,
456456 all callbacks are cleared. */
457457 Py_CLEAR (fut -> fut_callbacks );
@@ -619,7 +619,7 @@ future_get_result(FutureObj *fut, PyObject **result)
619619}
620620
621621static PyObject *
622- future_add_done_callback (FutureObj * fut , PyObject * arg , PyContext * ctx )
622+ future_add_done_callback (FutureObj * fut , PyObject * arg , PyObject * ctx )
623623{
624624 if (!future_is_alive (fut )) {
625625 PyErr_SetString (PyExc_RuntimeError , "uninitialized Future object" );
@@ -906,16 +906,15 @@ _asyncio_Future_add_done_callback_impl(FutureObj *self, PyObject *fn,
906906/*[clinic end generated code: output=7ce635bbc9554c1e input=15ab0693a96e9533]*/
907907{
908908 if (context == NULL ) {
909- context = ( PyObject * ) PyContext_CopyCurrent ();
909+ context = PyContext_CopyCurrent ();
910910 if (context == NULL ) {
911911 return NULL ;
912912 }
913- PyObject * res = future_add_done_callback (
914- self , fn , (PyContext * )context );
913+ PyObject * res = future_add_done_callback (self , fn , context );
915914 Py_DECREF (context );
916915 return res ;
917916 }
918- return future_add_done_callback (self , fn , ( PyContext * ) context );
917+ return future_add_done_callback (self , fn , context );
919918}
920919
921920/*[clinic input]
0 commit comments