Skip to content

Commit

Permalink
Prefer FileSystemLoader over PackageLoader
Browse files Browse the repository at this point in the history
  • Loading branch information
TimothyWillard committed Jan 6, 2025
1 parent 20bb555 commit 1d82cd4
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions flepimop/gempyor_pkg/src/gempyor/_jinja.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@


# Imports
from os.path import dirname
from pathlib import Path
from tempfile import mkstemp
from typing import Any
Expand All @@ -19,13 +20,11 @@

# Globals
try:
_jinja_environment = Environment(loader=PackageLoader("gempyor"))
except ValueError:
from os.path import dirname

_jinja_environment = Environment(
loader=FileSystemLoader(dirname(__file__).replace("\\", "/") + "/templates")
)
except ValueError:
_jinja_environment = Environment(loader=PackageLoader("gempyor"))


# Functions
Expand Down

0 comments on commit 1d82cd4

Please sign in to comment.