@@ -629,7 +629,7 @@ static int context_watcher_ids[NUM_CONTEXT_WATCHERS] = {-1, -1};
629629static int num_context_object_enter_events [NUM_CONTEXT_WATCHERS ] = {0 , 0 };
630630static int num_context_object_exit_events [NUM_CONTEXT_WATCHERS ] = {0 , 0 };
631631
632- static int
632+ static void
633633handle_context_watcher_event (int which_watcher , PyContextEvent event , PyObject * ctx ) {
634634 if (event == Py_CONTEXT_EVENT_ENTER ) {
635635 num_context_object_enter_events [which_watcher ]++ ;
@@ -638,30 +638,27 @@ handle_context_watcher_event(int which_watcher, PyContextEvent event, PyObject *
638638 num_context_object_exit_events [which_watcher ]++ ;
639639 }
640640 else {
641- return -1 ;
641+ Py_UNREACHABLE () ;
642642 }
643- return 0 ;
644643}
645644
646- static int
645+ static void
647646first_context_watcher_callback (PyContextEvent event , PyObject * ctx ) {
648- return handle_context_watcher_event (0 , event , ctx );
647+ handle_context_watcher_event (0 , event , ctx );
649648}
650649
651- static int
650+ static void
652651second_context_watcher_callback (PyContextEvent event , PyObject * ctx ) {
653- return handle_context_watcher_event (1 , event , ctx );
652+ handle_context_watcher_event (1 , event , ctx );
654653}
655654
656- static int
655+ static void
657656noop_context_event_handler (PyContextEvent event , PyObject * ctx ) {
658- return 0 ;
659657}
660658
661- static int
659+ static void
662660error_context_event_handler (PyContextEvent event , PyObject * ctx ) {
663661 PyErr_SetString (PyExc_RuntimeError , "boom!" );
664- return -1 ;
665662}
666663
667664static PyObject *
0 commit comments