From 0a0efac5c4251053796d6d8e107f12f1a2291b7c Mon Sep 17 00:00:00 2001 From: SimonPilkington Date: Wed, 6 Mar 2024 08:19:29 +0100 Subject: [PATCH] PixivUtil2.py: Handle EOFError in main_loop Sending an EOF to an application asking for input is a common way to tell it you're done on *nix. --- PixivUtil2.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/PixivUtil2.py b/PixivUtil2.py index 9d940d51..36368056 100644 --- a/PixivUtil2.py +++ b/PixivUtil2.py @@ -1501,6 +1501,9 @@ def main_loop(ewd, op_is_valid, selection, np_is_valid_local, args, options): PixivHelper.clearScreen() print("Restarting...") selection = menu() + except EOFError: + selection = 'x' + break except PixivException as ex: if ex.htmlPage is not None: filename = f"Dump for {PixivHelper.sanitize_filename(ex.value)}.html"