diff --git a/fill3/fill3/__init__.py b/fill3/fill3/__init__.py index 40fd07f..41e4de8 100755 --- a/fill3/fill3/__init__.py +++ b/fill3/fill3/__init__.py @@ -413,20 +413,18 @@ EXCEPTION = None _LAST_APPEARANCE = [] -def handle_exception(): - def decorating_func(func): - def wrapper(*args): - try: - return func(*args) - except Exception as exc: - global EXCEPTION - EXCEPTION = exc - SHUTDOWN_EVENT.set() - return wrapper - return decorating_func +def handle_exception(func): + def wrapper(*args): + try: + return func(*args) + except Exception as exc: + global EXCEPTION + EXCEPTION = exc + SHUTDOWN_EVENT.set() + return wrapper -@handle_exception() +@handle_exception def draw_screen(widget): global _LAST_APPEARANCE appearance = widget.appearance(os.get_terminal_size()) @@ -434,7 +432,7 @@ def draw_screen(widget): _LAST_APPEARANCE = appearance -@handle_exception() +@handle_exception def patch_screen(widget): global _LAST_APPEARANCE appearance = widget.appearance(os.get_terminal_size()) @@ -453,7 +451,7 @@ async def update_screen(screen_widget): APPEARANCE_CHANGED_EVENT.clear() -@handle_exception() +@handle_exception def on_terminal_input(screen_widget): term_code = sys.stdin.read() if term_code.startswith(terminal.MOUSE):