def threadProfileCode(func, *args, **kwargs):
    'Toplevel thread profile wrapper.'
    with ThreadProfiler(threading.current_thread()) as prof:
        try:
            prof.thread.status = threadProfileCode.__wrapped__(func, *args, **kwargs)
        except EscapeException as e:
            prof.thread.status = e
def threadProfileCode ( func , * args , ** kwargs ) : with ThreadProfiler ( threading . current_thread ( ) ) as prof : try : prof . thread . status = threadProfileCode . __wrapped__ ( func , * args , ** kwargs ) except EscapeException as e : prof . thread . status = e
Toplevel thread profile wrapper.