lib.ExecContext.get(): Raise FileNotFoundError

Raise FileNotFoundError from ExecContext.get() if the _run() returns
"No such File" in stderr.

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2026-04-17 13:31:47 +02:00
commit 154db1ebc4

View file

@ -282,6 +282,8 @@ class ExecContext(Base):
) )
except Exception as e: except Exception as e:
return cc.exception(ret, e) return cc.exception(ret, e)
if ret.status != 0 and ret.stderr.decode().find('No such file') != -1:
raise FileNotFoundError(ret.stderr)
cc.check_exit_code(ret) cc.check_exit_code(ret)
return ret return ret