diff options
-rw-r--r-- | sos/plugins/__init__.py | 6 | ||||
-rw-r--r-- | sos/sosreport.py | 5 |
2 files changed, 8 insertions, 3 deletions
diff --git a/sos/plugins/__init__.py b/sos/plugins/__init__.py index 2a8bc516..4d52b150 100644 --- a/sos/plugins/__init__.py +++ b/sos/plugins/__init__.py @@ -33,6 +33,12 @@ import errno import six from six.moves import zip, filter +# FileNotFoundError does not exist in 2.7, so map it to IOError +try: + FileNotFoundError +except NameError: + FileNotFoundError = IOError + def _to_u(s): if not isinstance(s, six.text_type): diff --git a/sos/sosreport.py b/sos/sosreport.py index 121459c1..8bfc95fd 100644 --- a/sos/sosreport.py +++ b/sos/sosreport.py @@ -791,7 +791,6 @@ class SoSReport(object): def _exit(self, error=0): raise SystemExit(error) -# sys.exit(error) def get_exit_handler(self): def exit_handler(signum, frame): @@ -1177,9 +1176,9 @@ class SoSReport(object): msg += _("Press ENTER to continue, or CTRL-C to quit.\n") try: input(msg) - except: + except Exception as err: self.ui_log.info("") - self._exit() + self._exit(err) def _log_plugin_exception(self, plugin, method): trace = traceback.format_exc() |