diff options
author | Pavel Moravec <pmoravec@redhat.com> | 2018-02-27 15:16:04 +0100 |
---|---|---|
committer | Bryn M. Reeves <bmr@redhat.com> | 2018-05-09 14:46:15 +0100 |
commit | 8673e0eccdba9012d77ed339df4108cdd998c739 (patch) | |
tree | 569a0a981aad658d46244479b7361f10c6daee3d | |
parent | 174e72e1c9c95b554914e846c5e150fa43fd699b (diff) | |
download | sos-8673e0eccdba9012d77ed339df4108cdd998c739.tar.gz |
[plugins] dont catch FileNotFoundError specifically
.. since it doesnt exist in py2, while parent class OSError does
Resolves: #1230
Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
-rw-r--r-- | sos/plugins/__init__.py | 4 |
1 files 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 |