forked from LBRYCommunity/lbry-sdk
hash.py dropping py2 backwards compat
This commit is contained in:
parent
5a2a3727b2
commit
746aef474a
1 changed files with 3 additions and 3 deletions
|
@ -182,13 +182,13 @@ class Base58(object):
|
||||||
@classmethod
|
@classmethod
|
||||||
def decode(cls, txt):
|
def decode(cls, txt):
|
||||||
""" Decodes txt into a big-endian bytearray. """
|
""" Decodes txt into a big-endian bytearray. """
|
||||||
if six.PY2 and isinstance(txt, buffer):
|
if isinstance(txt, memoryview):
|
||||||
txt = str(txt)
|
txt = str(txt)
|
||||||
|
|
||||||
if isinstance(txt, six.binary_type):
|
if isinstance(txt, bytes):
|
||||||
txt = txt.decode()
|
txt = txt.decode()
|
||||||
|
|
||||||
if not isinstance(txt, six.text_type):
|
if not isinstance(txt, str):
|
||||||
raise TypeError('a string is required')
|
raise TypeError('a string is required')
|
||||||
|
|
||||||
if not txt:
|
if not txt:
|
||||||
|
|
Loading…
Add table
Reference in a new issue