def set_debug_listener(stream):
def debugger(sig, frame):<EOL><INDENT>launch_debugger(frame, stream)<EOL><DEDENT>if hasattr(signal, '<STR_LIT>'):<EOL><INDENT>signal.signal(signal.SIGUSR1, debugger)<EOL><DEDENT>else:<EOL><INDENT>logger.warn("<STR_LIT>")<EOL><DEDENT>
Break into a debugger if receives the SIGUSR1 signal