OSDN Git Service

python/qemu: Adjust traceback typing
authorJohn Snow <jsnow@redhat.com>
Thu, 14 May 2020 05:53:44 +0000 (01:53 -0400)
committerPhilippe Mathieu-Daudé <philmd@redhat.com>
Sun, 31 May 2020 16:25:31 +0000 (18:25 +0200)
commit1dda0404d8afeb0ed45fbeae85e380e1ff57da35
treec1d0545fe4ac5d8de6c24b336f795c45e840ccdf
parent0add048fbd9992151e4c592977df9cff8558ca60
python/qemu: Adjust traceback typing

mypy considers it incorrect to use `bool` to statically return false,
because it will assume that it could conceivably return True, and gives
different analysis in that case. Use a None return to achieve the same
effect, but make mypy happy.

Note: Pylint considers function signatures as code that might trip the
duplicate-code checker. I'd rather not disable this as it does not
trigger often in practice, so I'm disabling it as a one-off and filed a
change request; see https://github.com/PyCQA/pylint/issues/3619

Signed-off-by: John Snow <jsnow@redhat.com>
Acked-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20200514055403.18902-14-jsnow@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
python/qemu/machine.py
python/qemu/qmp.py