Skip to content

Commit

Permalink
Improve error message when the type is not bytes
Browse files Browse the repository at this point in the history
  • Loading branch information
zkanda committed Jun 14, 2016
1 parent 600969b commit 5c24b8e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions base58.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@
def b58encode(v):
'''Encode a string using Base58'''

if not isinstance(v, bytes):
raise TypeError("a bytes-like object is required, not 'str'")

origlen = len(v)
v = v.lstrip(b'\0')
newlen = len(v)
Expand Down

0 comments on commit 5c24b8e

Please sign in to comment.