File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -283,7 +283,8 @@ def b16decode(s, casefold=False):
283283 s = _bytes_from_decode_data (s )
284284 if casefold :
285285 s = s .upper ()
286- if s .translate (None , delete = b'0123456789ABCDEF' ):
286+ delete = b'0123456789abcdef'
287+ if any (c not in delete for c in s ):
287288 raise binascii .Error ('Non-base16 digit found' )
288289 return binascii .unhexlify (s )
289290
@@ -462,7 +463,7 @@ def b85decode(b):
462463 # Delay the initialization of tables to not waste memory
463464 # if the function is never called
464465 if _b85dec is None :
465- _b85dec = [ None ] * 256
466+ _b85dec = bytearray ( 256 )
466467 for i , c in enumerate (_b85alphabet ):
467468 _b85dec [c ] = i
468469
@@ -579,7 +580,8 @@ def decodebytes(s):
579580# Usable as a script...
580581def main ():
581582 """Small main program"""
582- import sys , getopt
583+ import sys
584+ import getopt
583585 usage = f"""usage: { sys .argv [0 ]} [-h|-d|-e|-u] [file|-]
584586 -h: print this help message and exit
585587 -d, -u: decode
You can’t perform that action at this time.
0 commit comments