1
0
Fork 0
mirror of synced 2024-12-25 08:13:20 -05:00

Ensure temp_directory is always removed eventually

This commit is contained in:
Wu Tingfeng 2023-01-16 14:20:04 +08:00
parent cc8744d6ca
commit 89255ffb6c
No known key found for this signature in database

View file

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