mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Remove multiple returns
This commit is contained in:
parent
3fde850640
commit
d05999e28d
1 changed files with 2 additions and 6 deletions
|
@ -62,9 +62,7 @@ def text_(s, encoding='latin-1', errors='strict'):
|
|||
If ``s`` is an instance of ``binary_type``, return
|
||||
``s.decode(encoding, errors)``, otherwise return ``s``
|
||||
'''
|
||||
if isinstance(s, binary_type):
|
||||
return s.decode(encoding, errors)
|
||||
return s
|
||||
return s.decode(encoding, errors) if isinstance(s, binary_type) else s
|
||||
|
||||
|
||||
def bytes_(s, encoding='latin-1', errors='strict'):
|
||||
|
@ -72,9 +70,7 @@ def bytes_(s, encoding='latin-1', errors='strict'):
|
|||
If ``s`` is an instance of ``text_type``, return
|
||||
``s.encode(encoding, errors)``, otherwise return ``s``
|
||||
'''
|
||||
if isinstance(s, text_type):
|
||||
return s.encode(encoding, errors)
|
||||
return s
|
||||
return s.encode(encoding, errors) if isinstance(s, text_type) else s
|
||||
|
||||
|
||||
def ascii_native_(s):
|
||||
|
|
Loading…
Add table
Reference in a new issue