mirror of
https://github.com/certbot/certbot.git
synced 2026-06-07 15:52:08 -04:00
Special cased KeyboardInterrupt
This commit is contained in:
parent
e97719b367
commit
d6246ae309
2 changed files with 9 additions and 1 deletions
|
|
@ -676,10 +676,14 @@ def main(cli_args=sys.argv[1:]):
|
|||
except errors.Error as error:
|
||||
handle_exception_common()
|
||||
return error
|
||||
except: # pylint: disable=bare-except
|
||||
except KeyboardInterrupt:
|
||||
handle_exception_common()
|
||||
# Ensures a new line is printed
|
||||
return ""
|
||||
except: # pylint: disable=bare-except
|
||||
handle_exception_common()
|
||||
return ("\nAn unexpected error occured. Please see the logfiles in {0} "
|
||||
"for more details.".format(args.logs_dir))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
|
|
|||
|
|
@ -72,6 +72,10 @@ class CLITest(unittest.TestCase):
|
|||
self._call(['--debug'] + cmd_arg, attrs)
|
||||
self._call(cmd_arg, attrs)
|
||||
|
||||
attrs['view_config_changes.side_effect'] = [ValueError]
|
||||
with self.assertRaises(ValueError):
|
||||
self._call(['--debug'] + cmd_arg, attrs)
|
||||
self._call(cmd_arg, attrs)
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main() # pragma: no cover
|
||||
|
|
|
|||
Loading…
Reference in a new issue