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:
parent
045bb7c39c
commit
572a713f22
3
dist/tools/usb-serial/ttys.py
vendored
3
dist/tools/usb-serial/ttys.py
vendored
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user