Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removing the escape sequence from the console outputs! #141

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion aexpect/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Loading