[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v4 36/46] qapi/introspect.py: assert obj is a dict when features
From: |
John Snow |
Subject: |
[PATCH v4 36/46] qapi/introspect.py: assert obj is a dict when features are given |
Date: |
Wed, 30 Sep 2020 00:31:40 -0400 |
This is necessary to keep mypy passing in the next patch when we add
preliminary type hints. It will be removed shortly.
Signed-off-by: John Snow <jsnow@redhat.com>
---
scripts/qapi/introspect.py | 1 +
1 file changed, 1 insertion(+)
diff --git a/scripts/qapi/introspect.py b/scripts/qapi/introspect.py
index 31acd2f230a..83140f2c564 100644
--- a/scripts/qapi/introspect.py
+++ b/scripts/qapi/introspect.py
@@ -30,6 +30,7 @@ def _make_tree(obj, ifcond, features, extra=None):
if ifcond:
extra['if'] = ifcond
if features:
+ assert isinstance(obj, dict)
obj['features'] = [(f.name, {'if': f.ifcond}) for f in features]
if extra:
return (obj, extra)
--
2.26.2
- [PATCH v4 24/46] qapi/events.py: Move comments into docstrings, (continued)
- [PATCH v4 24/46] qapi/events.py: Move comments into docstrings, John Snow, 2020/09/30
- [PATCH v4 26/46] qapi/commands.py: add type hint annotations, John Snow, 2020/09/30
- [PATCH v4 27/46] qapi/commands.py: enable checking with mypy, John Snow, 2020/09/30
- [PATCH v4 29/46] qapi/source.py: delint with pylint, John Snow, 2020/09/30
- [PATCH v4 30/46] qapi/gen.py: Fix edge-case of _is_user_module, John Snow, 2020/09/30
- [PATCH v4 34/46] qapi/gen.py: update write() to be more idiomatic, John Snow, 2020/09/30
- [PATCH v4 32/46] qapi/gen.py: Enable checking with mypy, John Snow, 2020/09/30
- [PATCH v4 33/46] qapi/gen.py: Remove unused parameter, John Snow, 2020/09/30
- [PATCH v4 35/46] qapi/gen.py: delint with pylint, John Snow, 2020/09/30
- [PATCH v4 36/46] qapi/introspect.py: assert obj is a dict when features are given,
John Snow <=
- [PATCH v4 38/46] qapi/introspect.py: add _gen_features helper, John Snow, 2020/09/30
- [PATCH v4 40/46] qapi/introspect.py: replace 'extra' dict with 'comment' argument, John Snow, 2020/09/30
- [PATCH v4 42/46] qapi/types.py: add type hint annotations, John Snow, 2020/09/30
- [PATCH v4 44/46] qapi/visit.py: assert tag_member contains a QAPISchemaEnumType, John Snow, 2020/09/30
- [PATCH v4 45/46] qapi/visit.py: remove unused parameters from gen_visit_object, John Snow, 2020/09/30
- [PATCH v4 39/46] qapi/introspect.py: Unify return type of _make_tree(), John Snow, 2020/09/30