Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
sage_docbuild: do not fail when cache cannot be saved
Browse files Browse the repository at this point in the history
  • Loading branch information
tornaria committed Jan 9, 2022
1 parent 3832350 commit e89193f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/sage_docbuild/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -856,9 +856,12 @@ def save_cache(self):
Pickle the current reference cache for later retrieval.
"""
cache = self.get_cache()
with open(self.cache_filename(), 'wb') as file:
pickle.dump(cache, file)
logger.debug("Saved the reference cache: %s", self.cache_filename())
try:
with open(self.cache_filename(), 'wb') as file:
pickle.dump(cache, file)
logger.debug("Saved the reference cache: %s", self.cache_filename())
except PermissionError:
logger.debug("Permission denied for the reference cache: %s", self.cache_filename())

def get_sphinx_environment(self):
"""
Expand Down

0 comments on commit e89193f

Please sign in to comment.