Skip to content
Snippets Groups Projects

file write extension

Merged Florstedt, Julius requested to merge 43-confidential-issue into main
1 file
+ 3
1
Compare changes
  • Side-by-side
  • Inline
@@ -418,7 +418,9 @@ class Serializer:
if self._written_to_file:
raise NotImplementedError("You can only write the figure into the JSON once! Multiple tries were attempted")
if isinstance(file, str):
os.makedirs(os.path.dirname(file), exist_ok=True)
directory = os.path.dirname(file)
if directory:
os.makedirs(directory, exist_ok=True)
with open(file, "w") as file:
self.write_json_file(file)
else:
Loading