From c392563ef805bd17972c6a090423805ad001bd62 Mon Sep 17 00:00:00 2001 From: simon Date: Sat, 29 Oct 2022 15:52:33 +0700 Subject: [PATCH] use exist_ok for os.makedirs at startup --- tubearchivist/home/apps.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/tubearchivist/home/apps.py b/tubearchivist/home/apps.py index 1c44bbcc..5f97e5a9 100644 --- a/tubearchivist/home/apps.py +++ b/tubearchivist/home/apps.py @@ -63,10 +63,7 @@ class StartupCheck: cache_dir = self.config_handler.config["application"]["cache_dir"] for folder in folders: folder_path = os.path.join(cache_dir, folder) - try: - os.makedirs(folder_path) - except FileExistsError: - continue + os.makedirs(folder_path, exist_ok=True) def release_lock(self): """make sure there are no leftover locks set in redis"""