From 168be2b3afddd41d4575ed55439231812bc3e7c9 Mon Sep 17 00:00:00 2001 From: Kito Cheng Date: Wed, 23 Dec 2020 07:34:50 -0800 Subject: [PATCH] RISC-V: Fix python3 compatibility for multilib-generator The subprocess return string is raw bytes in python3, it must decode before used as string, verifed with python2 and python3. gcc/ChangeLog: * config/riscv/multilib-generator (arch_canonicalize): Call decode for the subprocess return value. --- gcc/config/riscv/multilib-generator | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/config/riscv/multilib-generator b/gcc/config/riscv/multilib-generator index ccfd9ea18ea..64ff15f449b 100755 --- a/gcc/config/riscv/multilib-generator +++ b/gcc/config/riscv/multilib-generator @@ -57,7 +57,7 @@ def arch_canonicalize(arch): proc = subprocess.Popen([sys.executable, arch_can_script, arch], stdout=subprocess.PIPE) out, err = proc.communicate() - return out.strip() + return out.decode().strip() # # Handle expansion operation. -- 2.30.2