Skip to content

Commit

Permalink
Catch exception that can happen on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
David Vitek committed Apr 14, 2022
1 parent 080260f commit 8fc431f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/jinja2/bccache.py
Expand Up @@ -269,6 +269,10 @@ def load_bytecode(self, bucket: Bucket) -> None:
f = open(filename, "rb")
except FileNotFoundError:
return
except PermissionError:
# This can occur on Windows when a rename and/or clear() is
# in progress.
return
with f:
bucket.load_bytecode(f)

Expand Down

0 comments on commit 8fc431f

Please sign in to comment.