Skip to content

Commit

Permalink
Ditch usage of importlib
Browse files Browse the repository at this point in the history
  • Loading branch information
trickeydan committed Feb 26, 2024
1 parent 97ef9a0 commit 898c19e
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions ctff/ctff.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""The main CTFF script."""
from __future__ import annotations

from importlib import resources
from pathlib import Path

import mistune
from flask import Flask, current_app, render_template
Expand All @@ -17,13 +17,12 @@ def __init__(
secret_key: bytes,
*,
title: str = "CTF",
template_folder: str | None = None,
template_folder: str | Path | None = None,
introduction_md: str | None = None,
introduction_html: str = "",
) -> None:
if template_folder is None:
with resources.path("ctff", "templates") as path:
template_folder = str(path.absolute())
template_folder = Path(__file__).parent.resolve() / "templates"

super().__init__(
"CTFF",
Expand Down

0 comments on commit 898c19e

Please sign in to comment.