Skip to content
Snippets Groups Projects
Commit afded359 authored by Alex Bennée's avatar Alex Bennée Committed by Paolo Bonzini
Browse files

python: add __repr__ to ConsoleSocket to aid debugging


While attempting to debug some console weirdness I thought it would be
worth making it easier to see what it had inside.

Signed-off-by: default avatarAlex Bennée <alex.bennee@linaro.org>
Reviewed-by: default avatarJohn Snow <jsnow@redhat.com>
Reviewed-by: default avatarWillian Rampazzo <willianr@redhat.com>
Message-Id: <20201210190417.31673-6-alex.bennee@linaro.org>
parent c87ea116
No related branches found
No related tags found
No related merge requests found
......@@ -45,6 +45,13 @@ def __init__(self, address: str, file: Optional[str] = None,
if drain:
self._drain_thread = self._thread_start()
def __repr__(self) -> str:
s = super().__repr__()
s = s.rstrip(">")
s = "%s, logfile=%s, drain_thread=%s>" % (s, self._logfile,
self._drain_thread)
return s
def _drain_fn(self) -> None:
"""Drains the socket and runs while the socket is open."""
while self._open:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment