NcursesDisplay.menu: treat ESC as cancel

Currently it will fire a weird traceback like:

File "/home/ubuntu/letsencrypt/letsencrypt/plugins/selection.py", line 113, in choose_plugin
    code, index = disp.menu(question, opts, help_label="More Info")
File "/home/ubuntu/letsencrypt/letsencrypt/display/util.py", line 129, in menu
    return code, int(index) - 1
ValueError: invalid literal for int() with base 10: ''
This commit is contained in:
Peter Eckersley 2016-04-05 11:33:33 -07:00
parent cb4fa906d8
commit ac2ec3457d

View file

@ -123,7 +123,7 @@ class NcursesDisplay(object):
# pylint: disable=star-args
code, index = self.dialog.menu(message, **menu_options)
if code == CANCEL:
if code == CANCEL or index == "":
return code, -1
return code, int(index) - 1