Fixed issue while using decode() without checking type of the variable. Type maybe string or byte.

pull/3/head
Ashesh Vashi 2016-05-16 13:22:10 +05:30 committed by Akshay Joshi
parent 8bd17cb433
commit 76087f3df3
1 changed files with 3 additions and 1 deletions

View File

@ -53,7 +53,9 @@ else:
from io import StringIO
def u(x):
return x.decode()
if hasattr(x, 'decode'):
return x.decode()
return x
def usage():