Fix ensure_dirs to work with paths

This commit is contained in:
Mikhail Gordeev 2019-11-04 21:37:18 +03:00
parent 04c99cc2f4
commit 2702fb96f4

View File

@ -180,7 +180,7 @@ class CB:
for attr in dir(self): for attr in dir(self):
if attr.endswith('_dir'): if attr.endswith('_dir'):
value = getattr(self, attr) value = getattr(self, attr)
if isinstance(value, str): if isinstance(value, str) or isinstance(value, os.PathLike):
os.makedirs(value, exist_ok=True) os.makedirs(value, exist_ok=True)
for branch in self.branches: for branch in self.branches:
os.makedirs(self.images_dir / branch, exist_ok=True) os.makedirs(self.images_dir / branch, exist_ok=True)