Skip to content

Commit

Permalink
Allow writing None to a file
Browse files Browse the repository at this point in the history
  • Loading branch information
nathandf committed Feb 10, 2024
1 parent 90fe177 commit 0ae4cb1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/engine/src/core/daos/FileSystemDAO.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@ def get(self, path: str):
return result

def write(self, path: str, contents):
contents = contents if contents != None else ""
with open(path, "w") as file:
file.write(contents)

def writebin(self, path: str, contents):
contents = contents if contents != None else ""
with open(path, "wb") as file:
file.write(contents)

0 comments on commit 0ae4cb1

Please sign in to comment.