Skip to content

Commit

Permalink
feat: write_to_file now handles both bytes and string types automatic…
Browse files Browse the repository at this point in the history
…ally
  • Loading branch information
thorwhalen committed Jan 17, 2025
1 parent 983aa93 commit 4d5189b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions dol/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -1884,8 +1884,12 @@ def read_from_bytes(


def write_to_file(obj: VT, key: KT):
with open(key, "wb") as f:
f.write(obj)
if isinstance(key, bytes):
with open(key, "wb") as f:
f.write(obj)
else:
with open(key, "w") as f:
f.write(obj)


def written_key(
Expand Down

0 comments on commit 4d5189b

Please sign in to comment.