From 24fa9a3fe3f5c6157b4c48e867e22bd2d335d18a Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 3 Feb 2022 17:31:18 +0100 Subject: [PATCH] fix in event parser --- parserbase/parser.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/parserbase/parser.py b/parserbase/parser.py index a29fa2c..8e27619 100644 --- a/parserbase/parser.py +++ b/parserbase/parser.py @@ -235,7 +235,7 @@ class FileParser: r"\[EXPORT][\s]*:[\s]*\[COMMENT]", moving_window[current_idx] ) if not descrip_match: - while current_idx > 0: + while True: if re.search( break_pattern, moving_window[current_idx] ): @@ -245,6 +245,8 @@ class FileParser: ) if descrip_match: break + if current_idx <= 0: + break current_idx -= 1 if descrip_match: current_build_idx = current_idx