1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

dist/tools/usb-serial: fix exception on missing entries

For some TTY interfaces no DB entry exists, which is reflected by
having a `None` in `tty[key]`. Trying to match a regex against `None`
in turn resulted then in an exception.

This fixes the issue by treating a filter applied on a non-existing
entry as not matching.
This commit is contained in:
Marian Buschsieweke 2022-12-05 11:02:36 +01:00
parent 045bb7c39c
commit 572a713f22
No known key found for this signature in database
GPG Key ID: CB8E3238CE715A94

View File

@ -47,6 +47,9 @@ def filters_match(filters, tty):
"""
for key, regex in filters:
if tty[key] is None:
return False
if not regex.match(tty[key]):
return False