hash.py dropping py2 backwards compat

This commit is contained in:
Lex Berezhny 2018-07-26 14:35:44 -04:00
parent 5a2a3727b2
commit 746aef474a

View file

@ -182,13 +182,13 @@ class Base58(object):
@classmethod
def decode(cls, txt):
""" Decodes txt into a big-endian bytearray. """
if six.PY2 and isinstance(txt, buffer):
if isinstance(txt, memoryview):
txt = str(txt)
if isinstance(txt, six.binary_type):
if isinstance(txt, bytes):
txt = txt.decode()
if not isinstance(txt, six.text_type):
if not isinstance(txt, str):
raise TypeError('a string is required')
if not txt: