6
0
mirror of https://github.com/ChristianLight/tutor.git synced 2024-12-12 06:07:56 +00:00

Avoid reliance on __file__

"__file__" does not work with some bundle compilers, such as pyoxidizer.
Also, it's not the recommended way to proceed. See
https://pyoxidizer.readthedocs.io/en/latest/packaging_pitfalls.html#reliance-on-file
This commit is contained in:
Régis Behmo 2019-08-20 17:04:18 +02:00
parent be1ff08917
commit c9adf68ba3

View File

@ -4,6 +4,7 @@ import os
import shutil
import jinja2
import pkg_resources
from . import exceptions
from . import fmt
@ -12,7 +13,7 @@ from . import utils
from .__about__ import __version__
TEMPLATES_ROOT = os.path.join(os.path.dirname(__file__), "templates")
TEMPLATES_ROOT = pkg_resources.resource_filename("tutor", "templates")
VERSION_FILENAME = "version"