Skip to content

Commit 4f34a41

Browse files
yvandervnashif
authored andcommitted
scripts: ci: check_compliance: fix split on ":" for Windows
The method get_kconfig_dts() relies on str's split() to split lines into fields separated by ':'. The second field is an absolute path to a file. On Windows, an absolute path includes a drive's letter followed by ':' which breaks the current code. On Linux, although rare, a file or directory name may also include ':', which would also break the code. The fix is to constraint the number of splits to 1. The code then becomes: _,b = line.split(":", 1) Signed-off-by: Yves Vandervennet <[email protected]>
1 parent bb27f05 commit 4f34a41

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

scripts/ci/check_compliance.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ def get_kconfig_dts(self, kconfig_dts_file, settings_file):
347347
lines = content.strip().split('\n')
348348
for line in lines:
349349
if line.startswith('"DTS_ROOT":'):
350-
_, dts_root_path = line.split(":")
350+
_, dts_root_path = line.split(":", 1)
351351
binding_paths.append(os.path.join(dts_root_path.strip('"'), "dts", "bindings"))
352352

353353
cmd = [sys.executable, zephyr_drv_kconfig_path,

0 commit comments

Comments
 (0)