From be1e1453da22420683ba90b89c4b498a2144157a Mon Sep 17 00:00:00 2001 From: Matthias Date: Fri, 19 Apr 2024 07:26:35 +0200 Subject: [PATCH] Further mutable-default fix to template-renderer --- freqtrade/util/template_renderer.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/freqtrade/util/template_renderer.py b/freqtrade/util/template_renderer.py index 6969c4c93..a875818bf 100644 --- a/freqtrade/util/template_renderer.py +++ b/freqtrade/util/template_renderer.py @@ -3,7 +3,7 @@ Jinja2 rendering utils, used to generate new strategy and configurations. """ -from typing import Dict +from typing import Dict, Optional def render_template(templatefile: str, arguments: Dict) -> str: @@ -19,11 +19,13 @@ def render_template(templatefile: str, arguments: Dict) -> str: def render_template_with_fallback(templatefile: str, templatefallbackfile: str, - arguments: dict = {}) -> str: + arguments: Optional[Dict] = None) -> str: """ Use templatefile if possible, otherwise fall back to templatefallbackfile """ from jinja2.exceptions import TemplateNotFound + if arguments is None: + arguments = {} try: return render_template(templatefile, arguments) except TemplateNotFound: