Skip to content

Commit 7b275cd

Browse files
author
Markus Armbruster
committed
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 ccea6a8 "qapi: Factor common recursion out of cgen_ifcond(), docgen_ifcond()". Tidy up. Signed-off-by: Markus Armbruster <[email protected]> Message-Id: <[email protected]> Reviewed-by: Marc-André Lureau <[email protected]>
1 parent abf7aee commit 7b275cd

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

scripts/qapi/common.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,8 @@ def gen_ifcond(ifcond: Optional[Union[str, Dict[str, Any]]],
205205
cond_fmt: str, not_fmt: str,
206206
all_operator: str, any_operator: str) -> str:
207207

208-
def do_gen(ifcond: Union[str, Dict[str, Any]], need_parens: bool):
208+
def do_gen(ifcond: Union[str, Dict[str, Any]],
209+
need_parens: bool) -> str:
209210
if isinstance(ifcond, str):
210211
return cond_fmt % ifcond
211212
assert isinstance(ifcond, dict) and len(ifcond) == 1

0 commit comments

Comments
 (0)