summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/qapi.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/scripts/qapi.py b/scripts/qapi.py
index 197db77..3656059 100644
--- a/scripts/qapi.py
+++ b/scripts/qapi.py
@@ -462,13 +462,15 @@ def check_type(expr_info, source, value, allow_array = False,
% (source, all_names[value], orig_value))
return
- # value is a dictionary, check that each member is okay
- if not isinstance(value, OrderedDict):
- raise QAPIExprError(expr_info,
- "%s should be a dictionary" % source)
if not allow_dict:
raise QAPIExprError(expr_info,
"%s should be a type name" % source)
+
+ if not isinstance(value, OrderedDict):
+ raise QAPIExprError(expr_info,
+ "%s should be a dictionary or type name" % source)
+
+ # value is a dictionary, check that each member is okay
for (key, arg) in value.items():
check_name(expr_info, "Member of %s" % source, key,
allow_optional=allow_optional)
OpenPOWER on IntegriCloud