#NEWLINE# def _do_on_future( self , callback , args , kwargs , future ) : #NEWLINE# #INDENT# if ( not future . done ( ) ) : #NEWLINE# #INDENT# future . set_exception ( TimeoutError ( 'Future timed out before yielding a result.' ) ) #NEWLINE# del kwargs . _future_timeouts [ future ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if isinstance ( future . exception ( ) , TimeoutError ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . unschedule ( self . _future_timeouts . pop ( future ) ) #NEWLINE# #UNINDENT# #UNINDENT# callback ( * args , ** kwargs )