[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v6 11/19] qapi/introspect.py: improve _tree_to_qlit error message
From: |
John Snow |
Subject: |
[PATCH v6 11/19] qapi/introspect.py: improve _tree_to_qlit error message |
Date: |
Mon, 15 Feb 2021 21:18:01 -0500 |
Trivial; make the error message just a pinch more explicit in case we
trip this by accident in the future.
Signed-off-by: John Snow <jsnow@redhat.com>
---
scripts/qapi/introspect.py | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/scripts/qapi/introspect.py b/scripts/qapi/introspect.py
index 5224be1a333..2ba0bfec733 100644
--- a/scripts/qapi/introspect.py
+++ b/scripts/qapi/introspect.py
@@ -125,7 +125,9 @@ def indent(level):
elif isinstance(obj, bool):
ret += 'QLIT_QBOOL(%s)' % ('true' if obj else 'false')
else:
- assert False # not implemented
+ raise NotImplementedError(
+ f"type '{type(obj).__name__}' not implemented"
+ )
if level > 0:
ret += ','
return ret
--
2.29.2
- Re: [PATCH v6 01/19] qapi: Replace List[str] with Sequence[str] for ifcond, (continued)
- [PATCH v6 03/19] qapi/introspect.py: use _make_tree for features nodes, John Snow, 2021/02/15
- [PATCH v6 06/19] qapi/introspect.py: Unify return type of _make_tree(), John Snow, 2021/02/15
- [PATCH v6 08/19] qapi/introspect.py: Always define all 'extra' dict keys, John Snow, 2021/02/15
- [PATCH v6 05/19] qapi/introspect.py: guard against ifcond/comment misuse, John Snow, 2021/02/15
- [PATCH v6 09/19] qapi/introspect.py: Introduce preliminary tree typing, John Snow, 2021/02/15
- [PATCH v6 13/19] qapi/introspect.py: remove _gen_variants helper, John Snow, 2021/02/15
- [PATCH v6 04/19] qapi/introspect.py: add _gen_features helper, John Snow, 2021/02/15
- [PATCH v6 12/19] qapi/introspect.py: improve readability of _tree_to_qlit, John Snow, 2021/02/15
- [PATCH v6 11/19] qapi/introspect.py: improve _tree_to_qlit error message,
John Snow <=
- [PATCH v6 14/19] qapi/introspect.py: add type hint annotations, John Snow, 2021/02/15
- Re: [PATCH v6 14/19] qapi/introspect.py: add type hint annotations, Markus Armbruster, 2021/02/16
- Re: [PATCH v6 14/19] qapi/introspect.py: add type hint annotations, Markus Armbruster, 2021/02/16
- Re: [PATCH v6 14/19] qapi/introspect.py: add type hint annotations, John Snow, 2021/02/16
- Re: [PATCH v6 14/19] qapi/introspect.py: add type hint annotations, Markus Armbruster, 2021/02/16
- Re: [PATCH v6 14/19] qapi/introspect.py: add type hint annotations, John Snow, 2021/02/16
- Re: [PATCH v6 14/19] qapi/introspect.py: add type hint annotations, Markus Armbruster, 2021/02/17
Re: [PATCH v6 14/19] qapi/introspect.py: add type hint annotations, Markus Armbruster, 2021/02/18
[PATCH v6 15/19] qapi/introspect.py: Add docstrings to _gen_tree and _tree_to_qlit, John Snow, 2021/02/15