From 89255ffb6caffd691629582abd00d3d3aaf56695 Mon Sep 17 00:00:00 2001 From: Wu Tingfeng Date: Mon, 16 Jan 2023 14:20:04 +0800 Subject: [PATCH] Ensure temp_directory is always removed eventually --- update_plugins.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/update_plugins.py b/update_plugins.py index 82d23845..0c8c144e 100644 --- a/update_plugins.py +++ b/update_plugins.py @@ -110,10 +110,10 @@ def update(plugin): if __name__ == "__main__": temp_directory = tempfile.mkdtemp() - if not path.isdir(SOURCE_DIR) or not listdir(SOURCE_DIR): - shutil.copytree(FALLBACK_SOURCE_DIR, SOURCE_DIR) - try: + if not path.isdir(SOURCE_DIR) or not listdir(SOURCE_DIR): + shutil.copytree(FALLBACK_SOURCE_DIR, SOURCE_DIR) + if futures: with futures.ThreadPoolExecutor(16) as executor: executor.map(update, PLUGINS.splitlines())