[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 26/47] qapi/commands.py: Don't re-bind to variable of differen
From: |
John Snow |
Subject: |
[PATCH v3 26/47] qapi/commands.py: Don't re-bind to variable of different type |
Date: |
Thu, 24 Sep 2020 20:28:39 -0400 |
Mypy isn't a fan of rebinding a variable with a new data type.
It's easy enough to avoid.
Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Cleber Rosa <crosa@redhat.com>
---
scripts/qapi/commands.py | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/scripts/qapi/commands.py b/scripts/qapi/commands.py
index f67393f871..586774a23c 100644
--- a/scripts/qapi/commands.py
+++ b/scripts/qapi/commands.py
@@ -195,14 +195,12 @@ def gen_register_command(name, success_response,
allow_oob, allow_preconfig):
if not options:
options = ['QCO_NO_OPTIONS']
- options = " | ".join(options)
-
ret = mcgen('''
qmp_register_command(cmds, "%(name)s",
qmp_marshal_%(c_name)s, %(opts)s);
''',
name=name, c_name=c_name(name),
- opts=options)
+ opts=" | ".join(options))
return ret
--
2.26.2
- [PATCH v3 25/47] qapi/events.py: Move comments into docstrings, (continued)
- [PATCH v3 25/47] qapi/events.py: Move comments into docstrings, John Snow, 2020/09/24
- [PATCH v3 16/47] qapi/common.py: Add indent manager, John Snow, 2020/09/24
- [PATCH v3 22/47] qapi/common.py: move build_params into gen.py, John Snow, 2020/09/24
- [PATCH v3 35/47] qapi/gen.py: update write() to be more idiomatic, John Snow, 2020/09/24
- [PATCH v3 27/47] qapi/commands.py: add type hint annotations, John Snow, 2020/09/24
- [PATCH v3 36/47] qapi/gen.py: delint with pylint, John Snow, 2020/09/24
- [PATCH v3 21/47] qapi/common.py: Convert comments into docstrings, and elaborate, John Snow, 2020/09/24
- [PATCH v3 41/47] qapi/introspect.py: replace 'extra' dict with 'comment' argument, John Snow, 2020/09/24
- [PATCH v3 43/47] qapi/types.py: add type hint annotations, John Snow, 2020/09/24
- [PATCH v3 28/47] qapi/commands.py: enable checking with mypy, John Snow, 2020/09/24
- [PATCH v3 26/47] qapi/commands.py: Don't re-bind to variable of different type,
John Snow <=
- [PATCH v3 29/47] qapi/source.py: add type hint annotations, John Snow, 2020/09/24
- [PATCH v3 34/47] qapi/gen.py: Remove unused parameter, John Snow, 2020/09/24
- [PATCH v3 18/47] qapi/common.py: Replace one-letter 'c' variable, John Snow, 2020/09/24
- [PATCH v3 30/47] qapi/source.py: delint with pylint, John Snow, 2020/09/24
- [PATCH v3 37/47] qapi/introspect.py: assert obj is a dict when features are given, John Snow, 2020/09/24
- [PATCH v3 45/47] qapi/visit.py: assert tag_member contains a QAPISchemaEnumType, John Snow, 2020/09/24
- [PATCH v3 31/47] qapi/gen.py: Fix edge-case of _is_user_module, John Snow, 2020/09/24
- [PATCH v3 39/47] qapi/introspect.py: add _gen_features helper, John Snow, 2020/09/24