def interactive_debug(sig, frame):
 d = {'_frame': frame}
 d.update(frame.f_globals)
 d.update(frame.f_locals)
 message = 'Signal received : entering python shell.\nTraceback:\n'
 message += ''.join(traceback.format_stack(frame))
 i = code.InteractiveConsole(d)
 i.interact(message)

def interactive_debug ( sig , frame ) : d = { '_frame' : frame } d . update ( frame . f_globals ) d . update ( frame . f_locals ) message = 'Signal received : entering python shell.\nTraceback:\n' message += '' . join ( traceback . format_stack ( frame ) ) i = code . InteractiveConsole ( d ) i . interact ( message )
interrupt running process .