Remove redundant try/catch block around os.makedirs()
This commit is contained in:
parent
aae65cc5d8
commit
de7b6ec22f
@ -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)
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user