mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2025-03-24 22:15:07 +00:00
qapi: Improve 'include' error message
Use of '"...%s" % include' to print non-strings can lead to ugly messages, such as this (if the .json change is applied without the qapi.py change): Expected a file name (string), got: OrderedDict() Better is to just omit the actual non-string value in the message. Backports commit 7408fb67c0f9403f6e40aecf97cf798fc14e2cd8 from qemu
This commit is contained in:
parent
02e411f666
commit
de2b67e528
|
@ -132,8 +132,7 @@ class QAPISchemaParser(object):
|
||||||
include = expr["include"]
|
include = expr["include"]
|
||||||
if not isinstance(include, str):
|
if not isinstance(include, str):
|
||||||
raise QAPIExprError(expr_info,
|
raise QAPIExprError(expr_info,
|
||||||
'Expected a file name (string), got: %s'
|
"Value of 'include' must be a string")
|
||||||
% include)
|
|
||||||
incl_abs_fname = os.path.join(os.path.dirname(abs_fname),
|
incl_abs_fname = os.path.join(os.path.dirname(abs_fname),
|
||||||
include)
|
include)
|
||||||
# catch inclusion cycle
|
# catch inclusion cycle
|
||||||
|
|
Loading…
Reference in a new issue