From ab9e55b398be3861526cda0456f0d9c1e9140700 Mon Sep 17 00:00:00 2001 From: FriedrichFroebel Date: Wed, 11 Oct 2023 19:29:17 +0200 Subject: [PATCH] Allow dataclasses in settings --- pelican/settings.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pelican/settings.py b/pelican/settings.py index 5b495e86..6196d62a 100644 --- a/pelican/settings.py +++ b/pelican/settings.py @@ -5,6 +5,7 @@ import locale import logging import os import re +import sys from os.path import isabs from pelican.log import LimitFilter @@ -13,6 +14,7 @@ from pelican.log import LimitFilter def load_source(name, path): spec = importlib.util.spec_from_file_location(name, path) mod = importlib.util.module_from_spec(spec) + sys.modules[name] = mod spec.loader.exec_module(mod) return mod