#NEWLINE# def run( self ) : #NEWLINE# #INDENT# while True : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# ( ident , func , args , kwargs ) = self . queue . get_nowait ( ) #NEWLINE# #UNINDENT# except Empty : #NEWLINE# #INDENT# break #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# result = func ( * args , ** kwargs ) #NEWLINE# self . results [ ident ] . append ( result ) #NEWLINE# #UNINDENT# except Exception as e : #NEWLINE# #INDENT# self . results [ ident ] . append ( e ) #NEWLINE# #UNINDENT# finally : #NEWLINE# #INDENT# self . queue . task_done ( ) #NEWLINE# #UNINDENT# #UNINDENT# return self . results