scripts: dts: improve error message on compatible type error

Print the offending value and its type.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
This commit is contained in:
Martí Bolívar 2019-11-13 11:05:52 -08:00 committed by Kumar Gala
parent 6e8132d1ae
commit 59e2f230e0

View File

@ -310,8 +310,10 @@ class EDT:
compatible = binding["compatible"]
if not isinstance(compatible, str):
_err("malformed 'compatible:' field in {} - should be a string"
.format(binding_path))
_err("malformed 'compatible: {}' field in {} - "
"should be a string, not {}"
.format(compatible, binding_path,
type(compatible).__name__))
return compatible