def tzname_in_python2(myfunc):
 def inner_func(*args, **kwargs):
  if PY3:
   return myfunc(*args, **kwargs)
  else:
   return myfunc(*args, **kwargs).encode()
 return inner_func

def tzname_in_python2 ( myfunc ) : def inner_func ( * args , ** kwargs ) : if PY3 : return myfunc ( * args , ** kwargs ) else : return myfunc ( * args , ** kwargs ) . encode ( ) return inner_func
change unicode output into bytestrings in python 2 tzname() api changed in python 3 .