ruff: enable bugbear checks (#1565)

This commit is contained in:
Adeeb Shihadeh
2023-08-06 14:59:22 -07:00
committed by GitHub
parent fc506e7b39
commit 3dc3b58e20
16 changed files with 34 additions and 175 deletions

View File

@@ -6,10 +6,8 @@ DEBUG = False
def msg(x):
if DEBUG:
print("S:", binascii.hexlify(x))
if len(x) <= 7:
ret = bytes([len(x)]) + x
else:
assert False
assert len(x) <= 7
ret = bytes([len(x)]) + x
return ret.ljust(8, b"\x00")
kmsgs = []
@@ -56,7 +54,7 @@ def isotp_recv_subaddr(panda, addr, bus, sendaddr, subaddr):
dat = msg[2:]
else:
print(binascii.hexlify(msg))
assert False
raise AssertionError
return dat[0:tlen]
@@ -133,7 +131,7 @@ def isotp_recv(panda, addr, bus=0, sendaddr=None, subaddr=None):
tlen = msg[0] & 0xf
dat = msg[1:]
else:
assert False
raise AssertionError
dat = dat[0:tlen]
if DEBUG:

View File

@@ -314,7 +314,7 @@ class STBootloaderSPIHandle(BaseSTBootloaderHandle):
self._mcu_type = MCU_TYPE_BY_IDCODE[self.get_chip_id()]
except PandaSpiException:
raise PandaSpiException("failed to connect to panda") # pylint: disable=W0707
raise PandaSpiException("failed to connect to panda") from None
def _get_ack(self, spi, timeout=1.0):
data = 0x00