On 11/19/24 16:05, Daniel P. Berrangé wrote:
The console interaction that waits for predicted strings uses
readline(), and thus is only capable of waiting for strings
that are followed by a newline.
This is inconvenient when needing to match on some things,
particularly login prompts, or shell p
On 11/19/24 19:54, Daniel P. Berrangé wrote:
+if success is None or success in msg:
As an optimization, you could use msg.endswith(success) and
msg.endswith(failure), which would avoid the most blatant cases of O(n^2)
behavior.
More important, I think "if success is None" should not be
On Tue, Nov 19, 2024 at 06:11:10PM +0100, Paolo Bonzini wrote:
> On 11/19/24 16:05, Daniel P. Berrangé wrote:
> > The console interaction that waits for predicted strings uses
> > readline(), and thus is only capable of waiting for strings
> > that are followed by a newline.
> >
> > This is inconv
The console interaction that waits for predicted strings uses
readline(), and thus is only capable of waiting for strings
that are followed by a newline.
This is inconvenient when needing to match on some things,
particularly login prompts, or shell prompts, causing tests
to use time.sleep(...) in