#NEWLINE# def _worker( executor_reference , work_queue ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# while True : #NEWLINE# #INDENT# work_item = work_queue . get ( block = True ) #NEWLINE# if ( work_item is not None ) : #NEWLINE# #INDENT# work_item . run ( ) #NEWLINE# continue #NEWLINE# #UNINDENT# executor = executor_reference ( ) #NEWLINE# if ( _shutdown or ( executor_reference is None ) or executor . _shutdown ) : #NEWLINE# #INDENT# work_queue . put ( None ) #NEWLINE# return #NEWLINE# #UNINDENT# del executor #NEWLINE# #UNINDENT# #UNINDENT# except BaseException : #NEWLINE# #INDENT# _base . LOGGER . critical ( 'Exception in worker' , exc_info = True )