From 7398eb304755ce92b6f13fa95adc78b7eae7b402 Mon Sep 17 00:00:00 2001 From: ThomasZecha Date: Mon, 19 Aug 2024 13:06:54 +0200 Subject: [PATCH] Fixed wrong stack trace dump -The function rewrite_traceback() assumes erroneously a fixed frame introducing the file name in the stack trace in case of exceptions during execution of the input file. This limition is removed with this patch so that all sizes of call stacks will be treated correctly. Signed-off-by: ThomasZecha --- pypreprocessor/__init__.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/pypreprocessor/__init__.py b/pypreprocessor/__init__.py index b0b2a07..ff95e3f 100644 --- a/pypreprocessor/__init__.py +++ b/pypreprocessor/__init__.py @@ -237,11 +237,7 @@ def rewrite_traceback(self): trace = traceback.format_exc().splitlines() index = 0 for line in trace: - if index == (len(trace) - 2): - print(line.replace("", self.input)) - else: - print(line) - index += 1 + print(line.replace("\"\"", self.input)) # parsing/processing def parse(self):