def _set_result_unless_cancelled(fut, result):
 if fut.cancelled():
  return
 fut.set_result(result)

def _set_result_unless_cancelled ( fut , result ) : if fut . cancelled ( ) : return fut . set_result ( result )
helper setting the result only if the future was not cancelled .