Restore ability to call expect() with a message and no matcher.
After the changes in D88792, expect can no longer be called as:
self.expect("some command", "some message")
After speaking to @jingham, I now understand that an uncommon use case is to
check only that a command succeeds, without validating its output. The changes
in D88792 prevent such expectations.
This change restores the ability to call expect this way, but with the
requirement that the msg argument be a keyword argument. Requiring msg be a
keyword argument provides the ability to ensure expect's arguments are
explict, and not ambiguous. Example:
self.expect("some command", msg="some message")
When lldb supports only Python 3, the easy solution will be to change the
signature of expect by require all arguments be keyword ags using its *
syntax:
def expect( self, str, *, msg=None, patterns=None, startstr=None, endstr=None, substrs=None, trace=False, error=False, ordered=True, matching=True, exe=True, inHistory=False):
But the * syntax is not supported in Python 2. To work around this, this change renames expect to _expect_impl, and implements expect as a separate function with a signature that separates positional args from keyword args, in order to perform validation.