From 8c06d22319cc45a2694e08323216460d0e53dee9 Mon Sep 17 00:00:00 2001 From: Anushree Mathur Date: Fri, 3 Jan 2025 23:48:34 +0530 Subject: [PATCH] Removing the escape sequence from the output! Testcases fail as the output is having escape sequence in it which is not expected to be there. Removing this escape sequence fixes almost 2000+ testcases. Signed-off-by: Anushree Mathur --- aexpect/client.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/aexpect/client.py b/aexpect/client.py index e0460f4..fbdcbdd 100644 --- a/aexpect/client.py +++ b/aexpect/client.py @@ -996,7 +996,9 @@ def read_until_last_line_matches(self, patterns, timeout=60.0, def _get_last_nonempty_line(cont): nonempty_lines = [_ for _ in cont.splitlines() if _.strip()] if nonempty_lines: - return nonempty_lines[-1] + # Removing escape sequence from the last element of nonempty_lines + nonempty_last_no_escape = astring.strip_console_codes(nonempty_lines[-1]) + return nonempty_last_no_escape return "" return self.read_until_output_matches(patterns,