From f48e23a890d010da2d2e28555e6b7289e1e52443 Mon Sep 17 00:00:00 2001 From: k4yt3x Date: Sun, 17 May 2020 15:50:05 -0400 Subject: [PATCH] ignore FileNotFoundError while clearing cache --- src/upscaler.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/upscaler.py b/src/upscaler.py index 1d5529e..b69940f 100755 --- a/src/upscaler.py +++ b/src/upscaler.py @@ -4,7 +4,7 @@ Name: Video2X Upscaler Author: K4YT3X Date Created: December 10, 2018 -Last Modified: May 16, 2020 +Last Modified: May 17, 2020 Description: This file contains the Upscaler class. Each instance of the Upscaler class is an upscaler on an image or @@ -134,7 +134,9 @@ class Upscaler: # therefore, plain print is used print(_('Cleaning up cache directory: {}').format(directory)) shutil.rmtree(directory) - except (OSError, FileNotFoundError): + except FileNotFoundError: + pass + except OSError: print(_('Unable to delete: {}').format(directory)) traceback.print_exc()