Skip to content
Snippets Groups Projects
Commit ef0d089b authored by Tiago de Freitas Pereira's avatar Tiago de Freitas Pereira
Browse files

Changed make dirs function

parent b2f1c962
Branches
Tags v2.0.7
1 merge request!12Not all functions implement the keyword argument create_directories
Pipeline #38375 failed
......@@ -315,12 +315,12 @@ class CheckpointMixin:
def save(self, sample):
if isinstance(sample, Sample):
path = self.make_path(sample)
bob.io.base.create_directories_safe(os.path.dirname(path))
os.makedirs(os.path.dirname(path), exist_ok=True)
return self.save_func(sample.data, path)
elif isinstance(sample, SampleSet):
for s in sample.samples:
path = self.make_path(s)
bob.io.base.create_directories_safe(os.path.dirname(path))
os.makedirs(os.path.dirname(path), exist_ok=True)
return self.save_func(s.data, path)
else:
raise ValueError("Type for sample not supported %s" % type(sample))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment