Skip to content

Commit

Permalink
ENH: auto-create file dirname in pickle_write()
Browse files Browse the repository at this point in the history
Match behavior of file_write().
  • Loading branch information
elcorto committed Nov 5, 2023
1 parent 52983c3 commit b8ea039
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/psweep/psweep.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ def file_read(fn: str):


def pickle_write(fn: str, obj):
makedirs(os.path.dirname(fn))
with open(fn, "wb") as fd:
pickle.dump(obj, fd)

Expand Down

0 comments on commit b8ea039

Please sign in to comment.