Use ternary operator instead

This commit is contained in:
Bo Maryniuk 2018-09-18 23:56:33 +02:00
parent d05999e28d
commit 40d0e6bed2

View file

@ -82,11 +82,8 @@ def ascii_native_(s):
'''
if isinstance(s, text_type):
s = s.encode('ascii')
if PY3:
s = str(s, 'ascii', 'strict')
else:
s = str(s)
return s
return str(s, 'ascii', 'strict') if PY3 else s
ascii_native_.__doc__ = '''