def handle_interrupt(func):
    """Decorator which ensures that keyboard interrupts are handled properly."""
    def wrapper():
        try:
            return func() or 0
        except KeyboardInterrupt:
            print('\n\033[31mError:\033[0m Aborted.')
            return 1
    return wrapper