parser: fix wrong message name check/print (#846)

* can do this

* or just this

* rm
This commit is contained in:
Shane Smiskol 2023-05-30 16:05:08 -07:00 committed by GitHub
parent bffa93d782
commit ae0d02ce2c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -61,9 +61,9 @@ cdef class CANParser:
for i in range(len(signals)):
s = signals[i]
if not isinstance(s[1], numbers.Number):
if name not in msg_name_to_address:
if s[1] not in msg_name_to_address:
print(msg_name_to_address)
raise RuntimeError(f"could not find message {repr(name)} in DBC {self.dbc_name}")
raise RuntimeError(f"could not find message {repr(s[1])} in DBC {self.dbc_name}")
s = (s[0], msg_name_to_address[s[1]])
signals[i] = s
@ -72,7 +72,7 @@ cdef class CANParser:
if not isinstance(c[0], numbers.Number):
if c[0] not in msg_name_to_address:
print(msg_name_to_address)
raise RuntimeError(f"could not find message {repr(name)} in DBC {self.dbc_name}")
raise RuntimeError(f"could not find message {repr(c[0])} in DBC {self.dbc_name}")
c = (msg_name_to_address[c[0]], c[1])
checks[i] = c