browson/utils.py
def signal_handler(signalnum, handler):
    """Install the given signal handler for the duration of this context."""

    def wrapped_handler(signum, frame):
        logger.debug(f"signal handler invoked with signal {signum}, {frame}")
        handler()

    prev = signal.signal(signalnum, wrapped_handler)
    try:
        yield
    finally:
        signal.signal(signalnum, prev)
Install the given signal handler for the duration of this context.
Install the given signal handler for the duration of this context.
Install the given signal handler for the duration of this context .
def signal_handler(signalnum, handler):
    def wrapped_handler(signum, frame):
        logger.debug(f"signal handler invoked with signal {signum}, {frame}")
        handler()
    prev = signal.signal(signalnum, wrapped_handler)
    try:
        yield
    finally:
        signal.signal(signalnum, prev)
def signal_handler ( signalnum , handler ) : def wrapped_handler ( signum , frame ) : logger . debug ( f"signal handler invoked with signal {signum}, {frame}" ) handler ( ) prev = signal . signal ( signalnum , wrapped_handler ) try : yield finally : signal . signal ( signalnum , prev )
Install the given signal handler for the duration of this context.
Install the given signal handler for the duration of this context .
"""Install the given signal handler for the duration of this context."""
signalnum
handler