tools/pyboard.py: Capture stdout for pts line.

The pts line printed by qemu-system-arm goes to stdout, not stderr.

Redirect stderr to stdout in case other tools do print to stderr.

Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
Damien George 2024-08-09 13:54:33 +10:00
parent a8d1c25a1b
commit b095c097e6

View file

@ -235,9 +235,9 @@ class ProcessPtyToTerminal:
preexec_fn=os.setsid,
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
stderr=subprocess.STDOUT,
)
pty_line = self.subp.stderr.readline().decode("utf-8")
pty_line = self.subp.stdout.readline().decode("utf-8")
m = re.search(r"/dev/pts/[0-9]+", pty_line)
if not m:
print("Error: unable to find PTY device in startup line:", pty_line)