Skip to content
utils.py 211 B
Newer Older
import signal


def signal_(signum):
    """Decorate a function to register as a handler to the signal."""

    def decorator(func):
        signal.signal(signum, func)
        return func

    return decorator