From 8804849a8dc324c6a033ca923df4b45d4fa78198 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sun, 30 May 2021 12:39:09 +0100 Subject: [PATCH] Remove any previous temporary files --- theme.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/theme.py b/theme.py index fd13faf60..7fdb0d720 100644 --- a/theme.py +++ b/theme.py @@ -24,8 +24,9 @@ def importTheme(baseDir: str, filename: str) -> bool: if not os.path.isfile(filename): return False tempThemeDir = baseDir + '/imports/files' - if not os.path.isdir(tempThemeDir): - os.mkdir(tempThemeDir) + if os.path.isdir(tempThemeDir): + rmtree(tempThemeDir) + os.mkdir(tempThemeDir) unpack_archive(filename, tempThemeDir, 'zip') essentialThemeFiles = ('name.txt', 'theme.json') for themeFile in essentialThemeFiles: