From 8512a9a7a12a78c63aafd77336e9e474f082dc23 Mon Sep 17 00:00:00 2001 From: derrod Date: Thu, 30 Dec 2021 17:11:52 +0100 Subject: [PATCH] [utils] Also only allow two empty invalid inputs --- legendary/utils/cli.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/legendary/utils/cli.py b/legendary/utils/cli.py index bfce13c..db46bfc 100644 --- a/legendary/utils/cli.py +++ b/legendary/utils/cli.py @@ -26,6 +26,9 @@ def get_int_choice(prompt, default=None, min_choice=None, max_choice=None, retur if default is not None: return default else: + if return_on_invalid: + return None + return_on_invalid = True continue else: if min_choice is not None and choice < min_choice: