avdtp: address review nits — use truthy checks

Per @zxzxwu review on #918:
- bumble/avdtp.py: replace `if len(pdu) < 1:` with `if not pdu:`
- tests/avdtp_test.py: replace `assert completed == []` with
  `assert not completed`

Both are idiomatic Python truthy checks; behavior identical.
This commit is contained in:
ibondarenko1
2026-04-26 18:49:55 -07:00
parent b874e26a4f
commit 07b5e33e09
2 changed files with 2 additions and 2 deletions

View File

@@ -314,7 +314,7 @@ class MessageAssembler:
# Drop empty PDUs sent by remote — accessing pdu[0] below would
# raise IndexError, propagating up to the L2CAP read loop and
# tearing down the channel. Same class as #912 (ATT empty PDU).
if len(pdu) < 1:
if not pdu:
logger.warning('AVDTP message assembler: empty PDU dropped')
return

View File

@@ -142,7 +142,7 @@ def test_message_assembler_truncated_pdu(pdu: bytes):
assembler = avdtp.MessageAssembler(callback)
# Must not raise; nothing should be delivered to callback either.
assembler.on_pdu(pdu)
assert completed == []
assert not completed
# -----------------------------------------------------------------------------