From b095c097e6cc49de6ba51f4d2ba43258f7f69d1b Mon Sep 17 00:00:00 2001 From: Damien George Date: Fri, 9 Aug 2024 13:54:33 +1000 Subject: [PATCH] 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 --- tools/pyboard.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/pyboard.py b/tools/pyboard.py index c422b64ac..55cbe8384 100755 --- a/tools/pyboard.py +++ b/tools/pyboard.py @@ -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)