aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2024-01-30 08:42:58 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2024-01-30 14:11:54 +0000
commitd010fe51c84d8b9d28a4902072f0bafa17c27ded (patch)
treeb44bad8c815cbac55d266f6e48003a31c484dc1d
parent663948a5c0b64155892e865cb476b0105a4413f7 (diff)
pyside_tool.py: Work around console encoding issues on Windows
Use subprocess.call() instead of capturing the output. As a drive-by, use stderr for error messages. Pick-to: 6.5 Change-Id: I28c9623754b0718cd4a5041475f451247ac5811f Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Tismer <tismer@stackless.com> (cherry picked from commit 3297df54f240705e5e8058cbae39f3f6e41effb5) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--sources/pyside-tools/pyside_tool.py11
1 files changed, 4 insertions, 7 deletions
diff --git a/sources/pyside-tools/pyside_tool.py b/sources/pyside-tools/pyside_tool.py
index 84bd61986..7daacc22d 100644
--- a/sources/pyside-tools/pyside_tool.py
+++ b/sources/pyside-tools/pyside_tool.py
@@ -8,7 +8,6 @@ import subprocess
import sys
import sysconfig
from pathlib import Path
-from subprocess import PIPE, Popen
import PySide6 as ref_mod
@@ -57,13 +56,11 @@ def qt_tool_wrapper(qt_tool, args, libexec=False):
exe = pyside_dir / qt_tool
cmd = [os.fspath(exe)] + args
- proc = Popen(cmd, stderr=PIPE)
- out, err = proc.communicate()
- if err:
- msg = err.decode("utf-8")
+ returncode = subprocess.call(cmd)
+ if returncode != 0:
command = ' '.join(cmd)
- print(f"Error: {msg}\nwhile executing '{command}'")
- sys.exit(proc.returncode)
+ print(f"'{command}' returned {returncode}", file=sys.stderr)
+ sys.exit(returncode)
def pyside_script_wrapper(script_name):