diff --git a/src/uwtools/config/jinja2.py b/src/uwtools/config/jinja2.py index 72726560a..cba03bae0 100644 --- a/src/uwtools/config/jinja2.py +++ b/src/uwtools/config/jinja2.py @@ -12,7 +12,7 @@ from jinja2 import Environment, FileSystemLoader, StrictUndefined, Undefined, meta from jinja2.exceptions import UndefinedError -from uwtools.config.support import UWYAMLConvert, UWYAMLRemove, format_to_config +from uwtools.config.support import UWYAMLConvert, UWYAMLRemove, format_to_config, uw_yaml_loader from uwtools.exceptions import UWConfigRealizeError from uwtools.logging import INDENT, MSGWIDTH, log from uwtools.utils.file import get_file_format, readable, writable @@ -269,7 +269,7 @@ def _deref_render(val: str, context: dict, local: Optional[dict] = None) -> str: context = {**(local or {}), **context} try: rendered = _register_filters(env).from_string(val).render(context) - if isinstance(yaml.safe_load(rendered), UWYAMLConvert): + if isinstance(yaml.load(rendered, Loader=uw_yaml_loader()), UWYAMLConvert): _deref_debug("Held", rendered) raise UWConfigRealizeError() _deref_debug("Rendered", rendered)