[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 1/5] qapi: Fix a botched type annotation
From: |
Markus Armbruster |
Subject: |
[PATCH 1/5] qapi: Fix a botched type annotation |
Date: |
Wed, 8 Sep 2021 06:54:24 +0200 |
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>
---
scripts/qapi/common.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/scripts/qapi/common.py b/scripts/qapi/common.py
index 5f8f76e5b2..c4d11b9637 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
--
2.31.1
- [PATCH 0/5] qapi: Another round of minor fixes and cleanups, Markus Armbruster, 2021/09/08
- [PATCH 4/5] tests/qapi-schema: Cover 'not' condition with empty argument, Markus Armbruster, 2021/09/08
- [PATCH 3/5] qapi: Bury some unused code in class Indentation, Markus Armbruster, 2021/09/08
- [PATCH 5/5] qapi: Fix bogus error for 'if': { 'not': '' }, Markus Armbruster, 2021/09/08
- [PATCH 1/5] qapi: Fix a botched type annotation,
Markus Armbruster <=
- [PATCH 2/5] qapi: Drop Indentation.__bool__(), Markus Armbruster, 2021/09/08
- Re: [PATCH 0/5] qapi: Another round of minor fixes and cleanups, Marc-André Lureau, 2021/09/08
- Re: [PATCH 0/5] qapi: Another round of minor fixes and cleanups, Markus Armbruster, 2021/09/13