diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2024-01-30 08:42:58 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2024-01-30 13:37:44 +0100 |
commit | 3297df54f240705e5e8058cbae39f3f6e41effb5 (patch) | |
tree | ad4cf34738847929a63d6caac6570cb171015d30 /sources/pyside-tools | |
parent | 59724b9a3160b9678ecfe98910fd75dd456089cd (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.6 6.5
Change-Id: I28c9623754b0718cd4a5041475f451247ac5811f
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'sources/pyside-tools')
-rw-r--r-- | sources/pyside-tools/pyside_tool.py | 11 |
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): |