mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Use ternary operator instead
This commit is contained in:
parent
d05999e28d
commit
40d0e6bed2
1 changed files with 2 additions and 5 deletions
|
@ -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__ = '''
|
||||
|
|
Loading…
Add table
Reference in a new issue