jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/794549 )
Change subject: [bugfix] Ignore KeyboardInterrupt in FamilyFileGenerator.get_params() ......................................................................
[bugfix] Ignore KeyboardInterrupt in FamilyFileGenerator.get_params()
Bug: T308919 Change-Id: I82748aa45cc1c6d032d163d8c935f67d8d0bb148 --- M pywikibot/scripts/generate_family_file.py 1 file changed, 5 insertions(+), 2 deletions(-)
Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/scripts/generate_family_file.py b/pywikibot/scripts/generate_family_file.py index 9b22ee3..934552a 100755 --- a/pywikibot/scripts/generate_family_file.py +++ b/pywikibot/scripts/generate_family_file.py @@ -37,6 +37,7 @@ import sys from typing import Optional from urllib.parse import urlparse +from contextlib import suppress
# see pywikibot.family.py @@ -91,12 +92,14 @@ def get_params(self) -> bool: # pragma: no cover """Ask for parameters if necessary.""" if self.base_url is None: - self.base_url = input('Please insert URL to wiki: ') + with suppress(KeyboardInterrupt): + self.base_url = input('Please insert URL to wiki: ') if not self.base_url: return False
if self.name is None: - self.name = input('Please insert a short name (eg: freeciv): ') + with suppress(KeyboardInterrupt): + self.name = input('Please insert a short name (eg: freeciv): ') if not self.name: return False
pywikibot-commits@lists.wikimedia.org