Reformat pexpect_helper.py with black

This commit is contained in:
ridiculousfish 2021-10-29 20:42:59 -07:00
parent 4118bda21c
commit f373e6e923

View File

@ -28,6 +28,7 @@ TIMEOUT_SECS = 5
UNEXPECTED_SUCCESS = object()
def get_prompt_re(counter):
"""Return a regular expression for matching a with a given prompt counter."""
return re.compile(
@ -129,7 +130,9 @@ class SpawnedProc(object):
function to ensure that each printed prompt is distinct.
"""
def __init__(self, name="fish", timeout=TIMEOUT_SECS, env=os.environ.copy(), **kwargs):
def __init__(
self, name="fish", timeout=TIMEOUT_SECS, env=os.environ.copy(), **kwargs
):
"""Construct from a name, timeout, and environment.
Args:
@ -146,7 +149,9 @@ class SpawnedProc(object):
self.colorize = sys.stdout.isatty() or env.get("FISH_FORCE_COLOR", "0") == "1"
self.messages = []
self.start_time = None
self.spawn = pexpect.spawn(exe_path, env=env, encoding="utf-8", timeout=timeout, **kwargs)
self.spawn = pexpect.spawn(
exe_path, env=env, encoding="utf-8", timeout=timeout, **kwargs
)
self.spawn.delaybeforesend = None
self.prompt_counter = 0