Skip to content

Commit

Permalink
Harden Jinja expectations and logger errors
Browse files Browse the repository at this point in the history
  • Loading branch information
manthey committed Jan 3, 2024
1 parent c1cc550 commit 3c58beb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion imagedephi/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ async def lifespan(app: FastAPI) -> AsyncGenerator[None, None]:
templates = Jinja2Templates(
# Jinja2Templates requires a "directory" argument, but it is effectively unused
# if a custom loader is passed
directory="",
directory=".",
loader=FunctionLoader(_load_template),
)

Expand Down
2 changes: 1 addition & 1 deletion imagedephi/utils/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
if os.path.exists("logging.conf")
else str(importlib.resources.files("imagedephi") / "logging.conf")
)
except KeyError:
except (FileNotFoundError, KeyError):
pass

logger = logging.getLogger("root")

0 comments on commit 3c58beb

Please sign in to comment.