From 820a82613a6ff820bfc959bf914d488a52a679df Mon Sep 17 00:00:00 2001 From: "Bryn M. Reeves" Date: Wed, 28 Mar 2018 12:42:33 +0100 Subject: [sosreport] remove exception handling from SoSReport.cleanup() It's pointless catching exceptions only to re-raise them. Signed-off-by: Bryn M. Reeves --- sos/sosreport.py | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/sos/sosreport.py b/sos/sosreport.py index 8bfc95fd..02d9b21c 100644 --- a/sos/sosreport.py +++ b/sos/sosreport.py @@ -1560,17 +1560,14 @@ class SoSReport(object): self.global_plugin_options[key] = value def _cleanup(self): - try: - # archive and tempfile cleanup may fail due to a fatal - # OSError exception (ENOSPC, EROFS etc.). - if self.archive: - self.archive.cleanup() - if self.tempfile_util: - self.tempfile_util.clean() - if self.tmpdir: - rmtree(self.tmpdir) - except: - raise + # archive and tempfile cleanup may fail due to a fatal + # OSError exception (ENOSPC, EROFS etc.). + if self.archive: + self.archive.cleanup() + if self.tempfile_util: + self.tempfile_util.clean() + if self.tmpdir: + rmtree(self.tmpdir) def execute(self): try: -- cgit