From ea005517cfe522f3562d570d3d85d16d7f9f2d29 Mon Sep 17 00:00:00 2001 From: I-Al-Istannen Date: Thu, 23 Apr 2020 12:09:45 +0200 Subject: [PATCH] Only remove folders if they exist in tmpdir --- PFERD/tmp_dir.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/PFERD/tmp_dir.py b/PFERD/tmp_dir.py index fc132b8..c634baa 100644 --- a/PFERD/tmp_dir.py +++ b/PFERD/tmp_dir.py @@ -69,7 +69,8 @@ class TmpDir(Location): """Delete this folder and all contained files.""" LOGGER.debug("Deleting temp folder %s", self.path) - shutil.rmtree(self.path.resolve()) + if self.path.resolve().exists(): + shutil.rmtree(self.path.resolve()) def _inc_and_get_counter(self) -> int: """Get and increment the counter by one."""