@@ -629,7 +629,7 @@ static int context_watcher_ids[NUM_CONTEXT_WATCHERS] = {-1, -1};
629
629
static int num_context_object_enter_events [NUM_CONTEXT_WATCHERS ] = {0 , 0 };
630
630
static int num_context_object_exit_events [NUM_CONTEXT_WATCHERS ] = {0 , 0 };
631
631
632
- static int
632
+ static void
633
633
handle_context_watcher_event (int which_watcher , PyContextEvent event , PyObject * ctx ) {
634
634
if (event == Py_CONTEXT_EVENT_ENTER ) {
635
635
num_context_object_enter_events [which_watcher ]++ ;
@@ -638,30 +638,27 @@ handle_context_watcher_event(int which_watcher, PyContextEvent event, PyObject *
638
638
num_context_object_exit_events [which_watcher ]++ ;
639
639
}
640
640
else {
641
- return -1 ;
641
+ Py_UNREACHABLE () ;
642
642
}
643
- return 0 ;
644
643
}
645
644
646
- static int
645
+ static void
647
646
first_context_watcher_callback (PyContextEvent event , PyObject * ctx ) {
648
- return handle_context_watcher_event (0 , event , ctx );
647
+ handle_context_watcher_event (0 , event , ctx );
649
648
}
650
649
651
- static int
650
+ static void
652
651
second_context_watcher_callback (PyContextEvent event , PyObject * ctx ) {
653
- return handle_context_watcher_event (1 , event , ctx );
652
+ handle_context_watcher_event (1 , event , ctx );
654
653
}
655
654
656
- static int
655
+ static void
657
656
noop_context_event_handler (PyContextEvent event , PyObject * ctx ) {
658
- return 0 ;
659
657
}
660
658
661
- static int
659
+ static void
662
660
error_context_event_handler (PyContextEvent event , PyObject * ctx ) {
663
661
PyErr_SetString (PyExc_RuntimeError , "boom!" );
664
- return -1 ;
665
662
}
666
663
667
664
static PyObject *
0 commit comments