python: cleanup should not crash if folder cannot be removed

Signed-off-by: Thorsten Liebig <Thorsten.Liebig@gmx.de>
pull/110/head
Thorsten Liebig 2023-02-22 18:57:52 +01:00
parent cbbae61c24
commit 704fad6dc4
1 changed files with 1 additions and 1 deletions

View File

@ -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)