Skip to content

Commit

Permalink
switch to json dump
Browse files Browse the repository at this point in the history
  • Loading branch information
jaydeluca committed Aug 13, 2023
1 parent 9516af4 commit a6a2be6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion multi_file_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def _generate_filename(self, key):
# Overwrites previous values
def add_to_cache(self, key, value):
with open(self._generate_filename(key), 'w') as file:
file.write(str(value))
json.dump(value, file)

def retrieve_value(self, key):
if os.path.exists(self._generate_filename(key)):
Expand Down

0 comments on commit a6a2be6

Please sign in to comment.