From: John Snow Date: Tue, 16 Feb 2021 02:17:56 +0000 (-0500) Subject: qapi/introspect.py: Unify return type of _make_tree() X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=84cf09915fdaba38a5d5f21baff38e94dd98607f;p=qemu.git qapi/introspect.py: Unify return type of _make_tree() Returning two different types conditionally can be complicated to type. Return one type for consistency. Signed-off-by: John Snow Message-Id: <20210216021809.134886-7-jsnow@redhat.com> Reviewed-by: Markus Armbruster Signed-off-by: Markus Armbruster --- diff --git a/scripts/qapi/introspect.py b/scripts/qapi/introspect.py index a111cec725..7cce0de975 100644 --- a/scripts/qapi/introspect.py +++ b/scripts/qapi/introspect.py @@ -29,9 +29,7 @@ def _make_tree(obj, ifcond, extra=None): extra = {} if ifcond: extra['if'] = ifcond - if extra: - return (obj, extra) - return obj + return (obj, extra) def _tree_to_qlit(obj, level=0, dict_value=False):