Skip to content

Commit

Permalink
fix linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
thijskramer committed Jun 5, 2023
1 parent 1b68f58 commit 9c1ed2c
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions django_vite/templatetags/django_vite.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,15 +301,14 @@ def _parse_manifest(self) -> None:
"""

try:
manifest_file = open(DJANGO_VITE_MANIFEST_PATH, "r")
manifest_content = manifest_file.read()
manifest_file.close()
with open(DJANGO_VITE_MANIFEST_PATH, "r") as manifest_file:
manifest_content = manifest_file.read()
self._manifest = json.loads(manifest_content)
except Exception as error:
raise RuntimeError(
f"Cannot read Vite manifest file at "
f"{DJANGO_VITE_MANIFEST_PATH} : {str(error)}"
)
) from error

@classmethod
def instance(cls):
Expand Down

0 comments on commit 9c1ed2c

Please sign in to comment.