aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2021-09-08 06:54:24 +0200
committerMarkus Armbruster <armbru@redhat.com>2021-09-08 15:30:10 +0200
commit7b275cdd69d5e6af0b95f4e6440d4664fe1c3674 (patch)
treef90a0203e477cf12f5eba3470f1e4a1db317cb0d /scripts
parentabf7aee72ea66944a62962603e4c2381f5e473e7 (diff)
downloadqemu-7b275cdd69d5e6af0b95f4e6440d4664fe1c3674.zip
qemu-7b275cdd69d5e6af0b95f4e6440d4664fe1c3674.tar.gz
qemu-7b275cdd69d5e6af0b95f4e6440d4664fe1c3674.tar.bz2
qapi: Fix a botched type annotation
Mypy is unhappy: $ mypy --config-file=scripts/qapi/mypy.ini `git-ls-files scripts/qapi/\*py` scripts/qapi/common.py:208: error: Function is missing a return type annotation scripts/qapi/common.py:227: error: Returning Any from function declared to return "str" Messed up in commit ccea6a8637 "qapi: Factor common recursion out of cgen_ifcond(), docgen_ifcond()". Tidy up. Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20210908045428.2689093-2-armbru@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/qapi/common.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/scripts/qapi/common.py b/scripts/qapi/common.py
index 5f8f76e..c4d11b9 100644
--- a/scripts/qapi/common.py
+++ b/scripts/qapi/common.py
@@ -205,7 +205,8 @@ def gen_ifcond(ifcond: Optional[Union[str, Dict[str, Any]]],
cond_fmt: str, not_fmt: str,
all_operator: str, any_operator: str) -> str:
- def do_gen(ifcond: Union[str, Dict[str, Any]], need_parens: bool):
+ def do_gen(ifcond: Union[str, Dict[str, Any]],
+ need_parens: bool) -> str:
if isinstance(ifcond, str):
return cond_fmt % ifcond
assert isinstance(ifcond, dict) and len(ifcond) == 1