compilers: fix crash when compiler check returns None output

Popen_safe_logged has a small inefficiency. It evaluates the stripped
version of stdout/stderr before checking if it exists, for logging
purposes. This would sometimes crash, if it was None instead of ''.

Fixes #12979
pull/13017/head
Eli Schwartz 12 months ago
parent 39f6d11792
commit c99fc40bb7
No known key found for this signature in database
GPG Key ID: CEB167EFB5722BD6
  1. 2
      mesonbuild/utils/universal.py

@ -1587,7 +1587,7 @@ def Popen_safe_logged(args: T.List[str], msg: str = 'Called', **kwargs: T.Any) -
mlog.debug(f'{msg}: `{join_args(args)}` -> {excp}')
raise
rc, out, err = p.returncode, o.strip(), e.strip()
rc, out, err = p.returncode, o.strip() if o else None, e.strip() if e else None
mlog.debug('-----------')
mlog.debug(f'{msg}: `{join_args(args)}` -> {rc}')
if out:

Loading…
Cancel
Save