#NEWLINE# def run( self , profiler ) : #NEWLINE# #INDENT# weak_profiler = weakref . proxy ( profiler ) #NEWLINE# handle = functools . partial ( self . handle_signal , weak_profiler ) #NEWLINE# t = self . interval #NEWLINE# with deferral ( ) as defer : #NEWLINE# #INDENT# prev_handle = signal . signal ( signal . SIGPROF , handle ) #NEWLINE# if ( prev_handle == signal . SIG_DFL ) : #NEWLINE# #INDENT# prev_handle = signal . SIG_IGN #NEWLINE# #UNINDENT# defer ( signal . signal , signal . SIGPROF , prev_handle ) #NEWLINE# prev_itimer = signal . setitimer ( signal . ITIMER_PROF , t , t ) #NEWLINE# defer ( signal . setitimer , signal . ITIMER_PROF , * prev_itimer ) #NEWLINE# ( yield )