@ffi.callback('int(void* handle, int revents)')
def _python_callback(handle, revents):
 try:
  the_watcher = ffi.from_handle(handle)
  args = the_watcher.args
  if (args is None):
   args = _NOARGS
  if ((len(args) > 0) and (args[0] == GEVENT_CORE_EVENTS)):
   args = ((revents,) + args[1:])
  the_watcher.callback(*args)
 except:
  the_watcher._exc_info = sys.exc_info()
  the_watcher.loop._keepaliveset.add(the_watcher)
  return (-1)
 else:
  if (the_watcher in the_watcher.loop._keepaliveset):
   return 0
  return 1

@ ffi . callback ( 'int(void* handle, int revents)' ) def _python_callback ( handle , revents ) : try : the_watcher = ffi . from_handle ( handle ) args = the_watcher . args if ( args is None ) : args = _NOARGS if ( ( len ( args ) > 0 ) and ( args [ 0 ] == GEVENT_CORE_EVENTS ) ) : args = ( ( revents , ) + args [ 1 : ] ) the_watcher . callback ( * args ) except : the_watcher . _exc_info = sys . exc_info ( ) the_watcher . loop . _keepaliveset . add ( the_watcher ) return ( - 1 ) else : if ( the_watcher in the_watcher . loop . _keepaliveset ) : return 0 return 1
returns an integer having one of three values: - -1 an exception occurred during the callback and you must call :func:_python_handle_error to deal with it .