#NEWLINE# def _election_thread( self , contender_id , election ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# election . run ( self . _leader_func , contender_id ) #NEWLINE# #UNINDENT# except UniqueError : #NEWLINE# #INDENT# if ( not self . raise_exception ) : #NEWLINE# #INDENT# self . thread_exc_info = sys . exc_info ( ) #NEWLINE# #UNINDENT# #UNINDENT# except Exception : #NEWLINE# #INDENT# self . thread_exc_info = sys . exc_info ( ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if self . raise_exception : #NEWLINE# #INDENT# e = Exception ( 'expected leader func to raise exception' ) #NEWLINE# self . thread_exc_info = ( Exception , e , None )