Abort on KeyboardInterrupts

This commit is contained in:
2Shirt 2021-05-07 02:38:55 -06:00
parent d2fb8250bc
commit 59fd85429c
Signed by: 2Shirt
GPG key ID: 152FAC923B0E132C
2 changed files with 7 additions and 1 deletions

View file

@ -88,6 +88,8 @@ BASE_MENUS = {
if __name__ == '__main__': if __name__ == '__main__':
try: try:
wk.repairs.win.run_auto_repairs(BASE_MENUS) wk.repairs.win.run_auto_repairs(BASE_MENUS)
except KeyboardInterrupt:
wk.std.abort()
except SystemExit: except SystemExit:
raise raise
except: #pylint: disable=bare-except except: #pylint: disable=bare-except

View file

@ -36,6 +36,7 @@ from wk.std import (
GenericWarning, GenericWarning,
Menu, Menu,
TryAndPrint, TryAndPrint,
abort,
ask, ask,
clear_screen, clear_screen,
color_string, color_string,
@ -397,7 +398,10 @@ def run_auto_repairs(base_menus):
for group, menu in menus.items(): for group, menu in menus.items():
if group in ('Main', 'Options'): if group in ('Main', 'Options'):
continue continue
run_group(group, menu) try:
run_group(group, menu)
except KeyboardInterrupt:
abort()
# Done # Done
end_session() end_session()