Remove redundant try/catch block around os.makedirs()

This commit is contained in:
flan 2017-11-08 13:49:28 +01:00
parent aae65cc5d8
commit de7b6ec22f

View File

@ -47,12 +47,7 @@ class CollectionWrapper:
"""Creates a new collection and runs any special setup."""
# mkdir -p the path, because it might not exist
dirname = os.path.dirname(self.path)
try:
os.makedirs(dirname)
except OSError as exc:
if exc.errno != errno.EEXIST:
raise
os.makedirs(os.path.dirname(self.path), exist_ok=True)
col = anki.storage.Collection(self.path, server=True)