When deleting a folder in the library and the folder has already been deleted do not fail

This commit is contained in:
Kovid Goyal 2015-08-31 08:24:34 +05:30
parent 22e9cbfa37
commit 37349f1e56

View File

@ -1111,7 +1111,9 @@ class DB(object):
if self.is_deletable(path): if self.is_deletable(path):
try: try:
shutil.rmtree(path) shutil.rmtree(path)
except: except EnvironmentError as e:
if e.errno == errno.ENOENT and not os.path.exists(path):
return
import traceback import traceback
traceback.print_exc() traceback.print_exc()
time.sleep(1) # In case something has temporarily locked a file time.sleep(1) # In case something has temporarily locked a file