Retry deleting since on windows something could have locked a file

This commit is contained in:
Kovid Goyal 2022-11-20 09:11:49 +05:30
parent 4e54cd601a
commit 7dbdfd565d
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -42,7 +42,11 @@ class FTSAPITest(BaseTest):
def new_library(self): def new_library(self):
if os.path.exists(self.library_path): if os.path.exists(self.library_path):
shutil.rmtree(self.library_path) try:
shutil.rmtree(self.library_path)
except PermissionError:
time.sleep(5)
shutil.rmtree(self.library_path)
os.makedirs(self.library_path) os.makedirs(self.library_path)
self.create_db(self.library_path) self.create_db(self.library_path)
ans = self.init_cache() ans = self.init_cache()