summaryrefslogtreecommitdiff
path: root/src/jwebmail
diff options
context:
space:
mode:
Diffstat (limited to 'src/jwebmail')
-rw-r--r--src/jwebmail/__init__.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/jwebmail/__init__.py b/src/jwebmail/__init__.py
index e1afe82..aa4d6a7 100644
--- a/src/jwebmail/__init__.py
+++ b/src/jwebmail/__init__.py
@@ -27,8 +27,10 @@ from .webmail import (
if sys.version_info >= (3, 11):
from tomllib import load as toml_load
+ toml_read_file = dict(load=toml_load, text=False)
else:
from toml import load as toml_load
+ toml_read_file = dict(load=toml_load, text=True)
__version__ = "2.0.0"
@@ -56,10 +58,9 @@ def create_app():
app.jinja_options = dict(undefined=ChainableUndefined)
if app.config["DEBUG"]:
- app.config.from_file("../../jwebmail.toml", load=toml_load, text=False)
+ app.config.from_file("../../jwebmail.toml", **toml_read_file)
else:
- print(environ["JWEBMAIL_CONFIG"])
- app.config.from_file(environ["JWEBMAIL_CONFIG"], load=toml_load, text=False)
+ app.config.from_file(environ["JWEBMAIL_CONFIG"], **toml_read_file)
if app.config["JWEBMAIL"]["PROXY"]:
app.wsgi_app = ProxyFix(app.wsgi_app, x_for=1, x_proto=1, x_host=1, x_prefix=1)