From 59e2f230e04583bd2f9caafe1c9d449eec620df2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=AD=20Bol=C3=ADvar?= Date: Wed, 13 Nov 2019 11:05:52 -0800 Subject: [PATCH] scripts: dts: improve error message on compatible type error MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Print the offending value and its type. Signed-off-by: Martí Bolívar --- scripts/dts/edtlib.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/dts/edtlib.py b/scripts/dts/edtlib.py index 9835a6cb8e3..9877f1157e9 100644 --- a/scripts/dts/edtlib.py +++ b/scripts/dts/edtlib.py @@ -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