> Sami> + > Sami> + if (!thread_event_obj || !thread) > Sami> + goto fail; > > You have to do error checks after each Python call, you can't batch them. > I have split the error checking. > Either: create_event_object can fail, in which case it is not ok to call > get_event_thread on failure; or, create_event_object can return NULL but > not set a Python exception, in which case you must set one explicitly. > Did you mean "or, get_event_thread" here ? I assumed so because get_event_thread can indeed return NULL without setting an error. I have fixed that be adding a call to PyErr_SetString. create_event_object on the other hand fails only due to failures in calls into the Python api. Which, presumably, do set errors. Sami