only return stderr if return code is not 0 (#4863)

This commit is contained in:
Nicolas Mowen 2023-01-02 16:31:59 -07:00 committed by GitHub
parent dc738e9be7
commit abc40f2581
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1250,10 +1250,10 @@ def vainfo():
{
"return_code": vainfo.returncode,
"stderr": vainfo.stderr.decode("unicode_escape").strip()
if vainfo.stderr.decode()
if vainfo.returncode != 0
else "",
"stdout": vainfo.stdout.decode("unicode_escape").strip()
if vainfo.stdout.decode()
if vainfo.returncode == 0
else "",
}
)