]> git.ipfire.org Git - thirdparty/qemu.git/commit
python: backport 'qmp-tui: Do not crash if optional dependencies are not met'
authorJohn Snow <jsnow@redhat.com>
Fri, 22 Jul 2022 19:55:45 +0000 (15:55 -0400)
committerMichael Tokarev <mjt@tls.msk.ru>
Tue, 16 Sep 2025 20:35:35 +0000 (23:35 +0300)
commitfd043dfa26d1fd005bbc5b9a33f99bee1db4e917
tree03effe7a6e5ac714b724e865185c0d105156f5c4
parentd997c7ca7de0a37e7a42209d875c3a0192090cb1
python: backport 'qmp-tui: Do not crash if optional dependencies are not met'

Based on the discussion at https://github.com/pypa/pip/issues/9726 -
even though the setuptools documentation implies that it is possible to
guard script execution with optional dependency groups, this is not true
in practice with the scripts generated by pip.

Just do the simple thing and guard the import statements.

Signed-off-by: John Snow <jsnow@redhat.com>
cherry picked from commit python-qemu-qmp@df520dcacf9a75dd4c82ab1129768de4128b554c
Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
(cherry picked from commit fd0ed46d4effbf2700804657bad9c6db086527c4)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
python/qemu/qmp/qmp_tui.py