Skip to content

Commit 6c65b15

Browse files
mbolivar-nordicnashif
authored andcommitted
edtlib: wrap DTError
Don't let a malformed devicetree escape as a DTError. Wrap it in an EDTError instead, so callers can just rely on the edtlib APIs as is generally expected. Signed-off-by: Martí Bolívar <[email protected]>
1 parent 7738977 commit 6c65b15

File tree

1 file changed

+4
-1
lines changed
  • scripts/dts/python-devicetree/src/devicetree

1 file changed

+4
-1
lines changed

scripts/dts/python-devicetree/src/devicetree/edtlib.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,10 @@ def __init__(self, dts, bindings_dirs,
201201
self.dts_path = dts
202202
self.bindings_dirs = bindings_dirs
203203

204-
self._dt = DT(dts)
204+
try:
205+
self._dt = DT(dts)
206+
except DTError as e:
207+
raise EDTError(e) from e
205208
_check_dt(self._dt)
206209

207210
self._init_compat2binding()

0 commit comments

Comments
 (0)