Use the function I specifically wrote for this!

This commit is contained in:
Itamar Turner-Trauring 2020-12-18 11:29:51 -05:00
parent 8f4a0379ea
commit 721b02b262

View File

@ -134,8 +134,7 @@ def a2b(cs):
@param cs the base-32 encoded data (as bytes) @param cs the base-32 encoded data (as bytes)
""" """
# Workaround Future newbytes issues by converting to real bytes on Python 2: # Workaround Future newbytes issues by converting to real bytes on Python 2:
if hasattr(cs, "__native__"): cs = backwardscompat_bytes(cs)
cs = cs.__native__()
precondition(could_be_base32_encoded(cs), "cs is required to be possibly base32 encoded data.", cs=cs) precondition(could_be_base32_encoded(cs), "cs is required to be possibly base32 encoded data.", cs=cs)
precondition(isinstance(cs, bytes), cs) precondition(isinstance(cs, bytes), cs)