python: backport 'qmp-shell-wrap: handle missing binary gracefully'

Signed-off-by: John Snow <jsnow@redhat.com>
cherry picked from commit python-qemu-qmp@9c889dcbd58817b0c917a9d2dd16161f48ac8203
Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
John Snow 2022-07-22 14:13:45 -04:00
parent a50b8572f0
commit fcaeeb7653

View file

@ -607,6 +607,8 @@ def main_wrap() -> None:
for _ in qemu.repl():
pass
except FileNotFoundError:
sys.stderr.write(f"ERROR: QEMU executable '{cmd[0]}' not found.\n")
finally:
os.unlink(sockpath)