Skip to content

Commit 7b2c894

Browse files
committed
fix code
1 parent 2650ec7 commit 7b2c894

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Lib/base64.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
'urlsafe_b64encode', 'urlsafe_b64decode',
2626
]
2727

28+
_ALLOWED_BASE16_CHARS = frozenset(b'0123456789ABCDEF')
2829

2930
bytes_types = (bytes, bytearray) # Types acceptable as binary data
3031

@@ -283,8 +284,7 @@ def b16decode(s, casefold=False):
283284
s = _bytes_from_decode_data(s)
284285
if casefold:
285286
s = s.upper()
286-
delete= b'0123456789abcdef'
287-
if any(c not in delete for c in s):
287+
if any(c not in _ALLOWED_BASE16_CHARS for c in s):
288288
raise binascii.Error('Non-base16 digit found')
289289
return binascii.unhexlify(s)
290290

0 commit comments

Comments
 (0)