@@ -59,7 +59,7 @@ typedef enum {
5959 PyObject_HEAD \
6060 PyObject *prefix##_loop; \
6161 PyObject *prefix##_callback0; \
62- PyContext *prefix##_context0; \
62+ PyObject *prefix##_context0; \
6363 PyObject *prefix##_callbacks; \
6464 PyObject *prefix##_exception; \
6565 PyObject *prefix##_result; \
@@ -78,7 +78,7 @@ typedef struct {
7878 FutureObj_HEAD (task )
7979 PyObject * task_fut_waiter ;
8080 PyObject * task_coro ;
81- PyContext * task_context ;
81+ PyObject * task_context ;
8282 int task_must_cancel ;
8383 int task_log_destroy_pending ;
8484} TaskObj ;
@@ -337,7 +337,7 @@ get_event_loop(void)
337337
338338
339339static int
340- call_soon (PyObject * loop , PyObject * func , PyObject * arg , PyContext * ctx )
340+ call_soon (PyObject * loop , PyObject * func , PyObject * arg , PyObject * ctx )
341341{
342342 PyObject * handle ;
343343 PyObject * stack [3 ];
@@ -448,7 +448,7 @@ future_schedule_callbacks(FutureObj *fut)
448448 PyObject * cb = PyTuple_GET_ITEM (cb_tup , 0 );
449449 PyObject * ctx = PyTuple_GET_ITEM (cb_tup , 1 );
450450
451- if (call_soon (fut -> fut_loop , cb , (PyObject * )fut , ( PyContext * ) ctx )) {
451+ if (call_soon (fut -> fut_loop , cb , (PyObject * )fut , ctx )) {
452452 /* If an error occurs in pure-Python implementation,
453453 all callbacks are cleared. */
454454 Py_CLEAR (fut -> fut_callbacks );
@@ -616,7 +616,7 @@ future_get_result(FutureObj *fut, PyObject **result)
616616}
617617
618618static PyObject *
619- future_add_done_callback (FutureObj * fut , PyObject * arg , PyContext * ctx )
619+ future_add_done_callback (FutureObj * fut , PyObject * arg , PyObject * ctx )
620620{
621621 if (!future_is_alive (fut )) {
622622 PyErr_SetString (PyExc_RuntimeError , "uninitialized Future object" );
@@ -903,16 +903,15 @@ _asyncio_Future_add_done_callback_impl(FutureObj *self, PyObject *fn,
903903/*[clinic end generated code: output=7ce635bbc9554c1e input=15ab0693a96e9533]*/
904904{
905905 if (context == NULL ) {
906- context = ( PyObject * ) PyContext_CopyCurrent ();
906+ context = PyContext_CopyCurrent ();
907907 if (context == NULL ) {
908908 return NULL ;
909909 }
910- PyObject * res = future_add_done_callback (
911- self , fn , (PyContext * )context );
910+ PyObject * res = future_add_done_callback (self , fn , context );
912911 Py_DECREF (context );
913912 return res ;
914913 }
915- return future_add_done_callback (self , fn , ( PyContext * ) context );
914+ return future_add_done_callback (self , fn , context );
916915}
917916
918917/*[clinic input]
0 commit comments