def _set_concurrent_future_state(concurr, source):
 assert source.done()
 if source.cancelled():
  concurr.cancel()
 if (not concurr.set_running_or_notify_cancel()):
  return
 exception = source.exception()
 if (exception is not None):
  concurr.set_exception(exception)
 else:
  result = source.result()
  concurr.set_result(result)

def _set_concurrent_future_state ( concurr , source ) : assert source . done ( ) if source . cancelled ( ) : concurr . cancel ( ) if ( not concurr . set_running_or_notify_cancel ( ) ) : return exception = source . exception ( ) if ( exception is not None ) : concurr . set_exception ( exception ) else : result = source . result ( ) concurr . set_result ( result )
copy state from a future to a concurrent .