From 704fad6dc4720f25db9e5aea960f2580e3f85dea Mon Sep 17 00:00:00 2001 From: Thorsten Liebig Date: Wed, 22 Feb 2023 18:57:52 +0100 Subject: [PATCH] python: cleanup should not crash if folder cannot be removed Signed-off-by: Thorsten Liebig --- python/openEMS/openEMS.pyx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/openEMS/openEMS.pyx b/python/openEMS/openEMS.pyx index 3a88032..a843c92 100644 --- a/python/openEMS/openEMS.pyx +++ b/python/openEMS/openEMS.pyx @@ -462,7 +462,7 @@ cdef class openEMS: :param numThreads: int -- set the number of threads (default 0 --> max) """ if cleanup and os.path.exists(sim_path): - shutil.rmtree(sim_path) + shutil.rmtree(sim_path, ignore_errors=True) os.mkdir(sim_path) if not os.path.exists(sim_path): os.mkdir(sim_path)