Skip to content

Commit

Permalink
Check if a string is instance of bytes
Browse files Browse the repository at this point in the history
  • Loading branch information
gdalmau committed Oct 11, 2017
1 parent f695fba commit 2b95987
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions sii/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@


def unidecode_str(s):
if type(s) is unicode:
res = unidecode(s)
elif type(s) is str:
if isinstance(s, bytes):
res = unidecode(s.decode('utf-8'))
else:
res = unidecode(s)
Expand Down

0 comments on commit 2b95987

Please sign in to comment.