From 4c5efa40872d13e33cb9047dac6a2c5133ce234f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20Ke=C3=9Fler?= Date: Fri, 17 Dec 2021 15:26:28 +0100 Subject: [PATCH] fix error when header is empty catch case of empty header to not crash --- build/utils/pytex_file.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/build/utils/pytex_file.py b/build/utils/pytex_file.py index 044b840..47d806a 100644 --- a/build/utils/pytex_file.py +++ b/build/utils/pytex_file.py @@ -68,11 +68,12 @@ class TexFileToFormat: def __format_header(self): new_header = [] - for line in self.current_build_info.header: - new_header.append(line.format( - source_file=self.src_path.name, - latex_file_type='package' if '.pysty' in self.src_path.name else 'class' - )) + if self.current_build_info.header: + for line in self.current_build_info.header: + new_header.append(line.format( + source_file=self.src_path.name, + latex_file_type='package' if '.pysty' in self.src_path.name else 'class' + )) self._header = new_header def __format(self) -> dict: