Config: Add diagnostic to paths_buf assert

The bare assert (len(paths_buf)) relies on truthiness which, while
correct, is misleading — readers might expect "assert len(paths_buf)
> 0" instead. Replace with an explicit comparison and add a diagnostic
message showing the actual length for easier debugging.

Assisted-by: unsloth/Qwen3.6-35B-A3B-GGUF:IQ4_NL with pi.dev v
Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2026-07-14 14:51:39 +02:00 • committed by janware DevOps
commit 1f3e38e685
Signed by: DevOps
SSH key fingerprint: SHA256:cZiw7ExG5q3KAVm7Jse3rGITowu0VjgUgNMPbifmY8g

View file

@ -43,7 +43,8 @@ class Config(): # export
slog(DEBUG, 'Reading config "{}"'.format(f))
paths_buf = []
tree = serdes.read(f, paths_buf = paths_buf)
assert (len(paths_buf))
assert len(paths_buf) > 0, \
f'Expected at least one path in paths_buf, got {len(paths_buf)}'
if refuse_mode_mask is not None:
for p in paths_buf:
st = os.stat(p)