diff mbox series

[v4,36/46] qapi/introspect.py: assert obj is a dict when features are given

Message ID 20200930043150.1454766-37-jsnow@redhat.com
State New
Headers show
Series qapi: static typing conversion, pt1 | expand

Commit Message

John Snow Sept. 30, 2020, 4:31 a.m. UTC
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(+)

Comments

Eduardo Habkost Sept. 30, 2020, 11:04 a.m. UTC | #1
On Wed, Sep 30, 2020 at 12:31:40AM -0400, John Snow wrote:
> 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>


Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>


-- 
Eduardo
diff mbox series

Patch

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)