def thunk_hook(type, value, trace):
 log_thunk_trace(value)
 __excepthook(type, value, trace)

def thunk_hook ( type , value , trace ) : log_thunk_trace ( value ) __excepthook ( type , value , trace )
this function is meant to replace excepthook and do some special work if the exception value has a __thunk_trace__ field .