From 1bbbdda1b1bdfc08f3f60e939c86c80ec4663608 Mon Sep 17 00:00:00 2001 From: RichardG867 Date: Sat, 15 Jan 2022 18:20:22 -0300 Subject: [PATCH] Only remove successfully-extracted ISOs --- biostools/extractors.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/biostools/extractors.py b/biostools/extractors.py index 16bf08e..8482f03 100644 --- a/biostools/extractors.py +++ b/biostools/extractors.py @@ -792,11 +792,12 @@ class ISOExtractor(ArchiveExtractor): # Finish new file. f_o.close() - # Remove ISO file. - try: - os.remove(file_path) - except: - pass + # Remove ISO file if it was successfully extracted. + if ret: + try: + os.remove(file_path) + except: + pass return ret