Popen_safe_logged: Also log exceptions
Popen can raise OSError when program is not found, or PermissionError if not executable, etc.
This commit is contained in:
parent
711e4e3b06
commit
13b626b67b
|
@ -1547,7 +1547,13 @@ def Popen_safe_logged(args: T.List[str], msg: str = 'Called', **kwargs: T.Any) -
|
|||
'''
|
||||
Wrapper around Popen_safe that assumes standard piped o/e and logs this to the meson log.
|
||||
'''
|
||||
p, o, e = Popen_safe(args, **kwargs)
|
||||
try:
|
||||
p, o, e = Popen_safe(args, **kwargs)
|
||||
except Exception as excp:
|
||||
mlog.debug('-----------')
|
||||
mlog.debug(f'{msg}: `{join_args(args)}` -> {excp}')
|
||||
raise
|
||||
|
||||
rc, out, err = p.returncode, o.strip(), e.strip()
|
||||
mlog.debug('-----------')
|
||||
mlog.debug(f'{msg}: `{join_args(args)}` -> {rc}')
|
||||
|
|
Loading…
Reference in New Issue