From 61c3f8a4404fd89d272bfcbc850d572880d66b1e Mon Sep 17 00:00:00 2001 From: Feiyun Wang Date: Fri, 31 Mar 2023 20:57:17 +0800 Subject: [PATCH] Fix #1059: Linking for mingw/x86_64 on MSYS2 fails --- tools/my_spawn.py | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/tools/my_spawn.py b/tools/my_spawn.py index 0b21419aa0..542d513594 100644 --- a/tools/my_spawn.py +++ b/tools/my_spawn.py @@ -11,23 +11,16 @@ def configure(env): import subprocess def mySubProcess(cmdline, env): - # print "SPAWNED : " + cmdline - startupinfo = subprocess.STARTUPINFO() - startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW - proc = subprocess.Popen( - cmdline, - stdin=subprocess.PIPE, - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - startupinfo=startupinfo, - shell=False, + # print("SPAWNED: " + cmdline) + proc = subprocess.run( + args=cmdline, + shell=True, env=env, ) - data, err = proc.communicate() - rv = proc.wait() + rv = proc.returncode if rv: print("=====") - print(err.decode("utf-8")) + print(rv, "(", hex(rv), ")") print("=====") return rv