mirror of
https://github.com/certbot/certbot.git
synced 2026-07-27 00:00:44 +02:00
Special cased KeyboardInterrupt
This commit is contained in:
+5
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user