From 8673e0eccdba9012d77ed339df4108cdd998c739 Mon Sep 17 00:00:00 2001 From: Pavel Moravec Date: Tue, 27 Feb 2018 15:16:04 +0100 Subject: [plugins] dont catch FileNotFoundError specifically .. since it doesnt exist in py2, while parent class OSError does Resolves: #1230 Signed-off-by: Pavel Moravec Signed-off-by: Bryn M. Reeves --- sos/plugins/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sos/plugins/__init__.py b/sos/plugins/__init__.py index ea19ee57..78de61f6 100644 --- a/sos/plugins/__init__.py +++ b/sos/plugins/__init__.py @@ -574,7 +574,7 @@ class Plugin(object): def getmtime(path): try: return os.path.getmtime(path) - except (OSError, FileNotFoundError): + except OSError: return 0 files.sort(key=getmtime, reverse=True) @@ -585,7 +585,7 @@ class Plugin(object): for _file in files: try: current_size += os.stat(_file)[stat.ST_SIZE] - except (OSError, FileNotFoundError): + except OSError: self._log_info("failed to stat '%s'" % _file) if sizelimit and current_size > sizelimit: limit_reached = True -- cgit