diff options
author | Andres Gomez <agomez@igalia.com> | 2021-05-17 22:50:21 +0300 |
---|---|---|
committer | Andres Gomez <agomez@igalia.com> | 2021-05-18 12:06:44 +0300 |
commit | 9d87cc3d79e0c7e572273b94dcb51882f4d83d7f (patch) | |
tree | 6c0385fed493ec04ca49be08d39dfa578c05dc7d /framework/replay/backends/abstract.py | |
parent | 3b84e8a37ec149160e95aef2e9b0dfa262da7d69 (diff) |
framework/replay: send backend's subprocess stderr to sys.stderr
Make it explicit, in case it was redirected for the parent process.
See: https://bugs.python.org/issue44158
Signed-off-by: Andres Gomez <agomez@igalia.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Martin Peres <martin.peres@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/piglit/-/merge_requests/534>
Diffstat (limited to 'framework/replay/backends/abstract.py')
-rw-r--r-- | framework/replay/backends/abstract.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/framework/replay/backends/abstract.py b/framework/replay/backends/abstract.py index f84a4e0e3..937d3a8d1 100644 --- a/framework/replay/backends/abstract.py +++ b/framework/replay/backends/abstract.py @@ -33,6 +33,7 @@ This module provides a base class for replayer dump backend modules. import abc import functools import subprocess +import sys from os import path @@ -89,7 +90,12 @@ class DumpBackend(metaclass=abc.ABCMeta): @staticmethod def _run_logged_command(cmd, env): - ret = subprocess.run(cmd, stdout=subprocess.PIPE, env=env) + # Explicitly send the stderr to the fd at sys.stderr in case it was + # redirected for the parent process. + # See: + # https://bugs.python.org/issue44158 + ret = subprocess.run(cmd, stdout=subprocess.PIPE, stderr=sys.stderr, + env=env) logoutput = '[dump_trace_images] Running: {}\n'.format( ' '.join(cmd)).encode() + ret.stdout print(logoutput.decode(errors='replace')) |