only decode decarg results on python 2

This commit is contained in:
Johnny Robeson 2016-06-28 23:32:46 -04:00
parent 5d4e3396d2
commit 159e24a14b

View file

@ -122,9 +122,12 @@ def _arg_encoding():
def decargs(arglist):
"""Given a list of command-line argument bytestrings, attempts to
decode them to Unicode strings.
decode them to Unicode strings when running under Python 2.
"""
return [s.decode(_arg_encoding()) for s in arglist]
if six.PY2:
return [s.decode(_arg_encoding()) for s in arglist]
else:
return arglist
def print_(*strings, **kwargs):