From ccc5e7cb28ba9d2cb7eab92a5aa3b2b4b639de4b Mon Sep 17 00:00:00 2001 From: Fabian Homborg Date: Fri, 12 Feb 2021 18:19:20 +0100 Subject: [PATCH] pexpect: Pass on keyword arguments to spawn() This is useful for all the additional pexpect features. --- build_tools/pexpect_helper.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build_tools/pexpect_helper.py b/build_tools/pexpect_helper.py index a7379a0de..d4fc26dd0 100644 --- a/build_tools/pexpect_helper.py +++ b/build_tools/pexpect_helper.py @@ -126,7 +126,7 @@ class SpawnedProc(object): function to ensure that each printed prompt is distinct. """ - def __init__(self, name="fish", timeout=TIMEOUT_SECS, env=os.environ.copy()): + def __init__(self, name="fish", timeout=TIMEOUT_SECS, env=os.environ.copy(), **kwargs): """Construct from a name, timeout, and environment. Args: @@ -143,7 +143,7 @@ class SpawnedProc(object): self.colorize = sys.stdout.isatty() self.messages = [] self.start_time = None - self.spawn = pexpect.spawn(exe_path, env=env, encoding="utf-8", timeout=timeout) + self.spawn = pexpect.spawn(exe_path, env=env, encoding="utf-8", timeout=timeout, **kwargs) self.spawn.delaybeforesend = None self.prompt_counter = 0