Skip to content

Commit cee9d64

Browse files
karldinghardbyte
authored andcommitted
Raise Exception instead of using assert on EINVAL
1 parent 0e3812d commit cee9d64

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

can/interfaces/socketcan/socketcan.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,8 @@ def _tx_setup(self, message):
364364
try:
365365
self.bcm_socket.send(check_header)
366366
except OSError as e:
367-
assert e.errno == errno.EINVAL
367+
if e.errno != errno.EINVAL:
368+
raise e
368369
else:
369370
raise ValueError(
370371
"A periodic Task for Arbitration ID {} has already been created".format(

0 commit comments

Comments
 (0)