From 386423892e43a3c2ea3ea7de8b17a09a23658faf Mon Sep 17 00:00:00 2001
From: cmoineau <cyril.moineau@cea.fr>
Date: Fri, 20 Sep 2024 11:14:53 +0000
Subject: [PATCH] Jinja rendering keep_trailing_newline=True

---
 aidge_core/export_utils/code_generation.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/aidge_core/export_utils/code_generation.py b/aidge_core/export_utils/code_generation.py
index d48970b0f..995df18b5 100644
--- a/aidge_core/export_utils/code_generation.py
+++ b/aidge_core/export_utils/code_generation.py
@@ -40,7 +40,7 @@ def generate_str(template_path: Union[Path, str], **kwargs) -> str:
     if isinstance(template_path, str):
         template_path = Path(template_path)
     return Environment(loader=FileSystemLoader(
-        template_path.parent), undefined=StrictUndefined).get_template(template_path.name).render(kwargs)
+        template_path.parent), undefined=StrictUndefined, keep_trailing_newline=True).get_template(template_path.name).render(kwargs)
 
 def copy_file(filename, dst_folder):
 
-- 
GitLab