ring-builder: Abort cleanly on ^C, ^D
Change-Id: If8fbcaff8e5676accb10e6c3c49387bc0de0cdb9
This commit is contained in:
parent
57ce156a7f
commit
f264b53a2e
|
@ -194,7 +194,11 @@ def check_devs(devs, input_question, opts, abort_msg):
|
|||
print('Matched more than one device:')
|
||||
for dev in devs:
|
||||
print(' %s' % format_device(dev))
|
||||
if not opts.yes and input(input_question) != 'y':
|
||||
try:
|
||||
abort = not opts.yes and input(input_question) != 'y'
|
||||
except (EOFError, KeyboardInterrupt):
|
||||
abort = True
|
||||
if abort:
|
||||
print(abort_msg)
|
||||
exit(EXIT_ERROR)
|
||||
|
||||
|
|
Loading…
Reference in New Issue