Skip to content

Commit 3f48c0e

Browse files
fix(webhooks): drop redundant binascii.Error in except (B014)
binascii.Error is a subclass of ValueError, so listing both in the except clause triggers flake8-bugbear B014. Catching ValueError alone covers both cases. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 7402f18 commit 3f48c0e

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

stream_chat/webhook.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
"""
1616

1717
import base64
18-
import binascii
1918
import gzip
2019
import hashlib
2120
import hmac
@@ -66,7 +65,7 @@ def decode_sqs_payload(body: _BytesLike) -> bytes:
6665
raw = _to_bytes(body)
6766
try:
6867
decoded = base64.b64decode(raw, validate=True)
69-
except (binascii.Error, ValueError) as exc:
68+
except ValueError as exc:
7069
raise WebhookSignatureError(f"failed to base64-decode payload: {exc}")
7170
return ungzip_payload(decoded)
7271

0 commit comments

Comments
 (0)