summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Snow2021-02-16 03:17:56 +0100
committerMarkus Armbruster2021-02-18 19:37:41 +0100
commit84cf09915fdaba38a5d5f21baff38e94dd98607f (patch)
treeb6c1b35d40c2876a67b279cb035ab371d77b9bfb
parentqapi/introspect.py: guard against ifcond/comment misuse (diff)
downloadqemu-84cf09915fdaba38a5d5f21baff38e94dd98607f.tar.gz
qemu-84cf09915fdaba38a5d5f21baff38e94dd98607f.tar.xz
qemu-84cf09915fdaba38a5d5f21baff38e94dd98607f.zip
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 <jsnow@redhat.com> Message-Id: <20210216021809.134886-7-jsnow@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
-rw-r--r--scripts/qapi/introspect.py4
1 files changed, 1 insertions, 3 deletions
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):