mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Skip pylint false-positives
This commit is contained in:
parent
f14f4dae22
commit
53ba10ad5f
1 changed files with 4 additions and 4 deletions
|
@ -57,7 +57,7 @@ def to_bytes(s, encoding=None, errors='strict'):
|
|||
# The only way we get this far is if a UnicodeEncodeError was
|
||||
# raised, otherwise we would have already returned (or raised some
|
||||
# other exception).
|
||||
raise exc
|
||||
raise exc # pylint: disable=raising-bad-type
|
||||
raise TypeError('expected bytes, bytearray, or str')
|
||||
else:
|
||||
return to_str(s, encoding, errors)
|
||||
|
@ -99,7 +99,7 @@ def to_str(s, encoding=None, errors='strict', normalize=False):
|
|||
# The only way we get this far is if a UnicodeDecodeError was
|
||||
# raised, otherwise we would have already returned (or raised some
|
||||
# other exception).
|
||||
raise exc
|
||||
raise exc # pylint: disable=raising-bad-type
|
||||
raise TypeError('expected str, bytes, or bytearray not {}'.format(type(s)))
|
||||
else:
|
||||
if isinstance(s, bytearray):
|
||||
|
@ -114,7 +114,7 @@ def to_str(s, encoding=None, errors='strict', normalize=False):
|
|||
# The only way we get this far is if a UnicodeDecodeError was
|
||||
# raised, otherwise we would have already returned (or raised some
|
||||
# other exception).
|
||||
raise exc
|
||||
raise exc # pylint: disable=raising-bad-type
|
||||
raise TypeError('expected str, bytearray, or unicode')
|
||||
|
||||
|
||||
|
@ -157,7 +157,7 @@ def to_unicode(s, encoding=None, errors='strict', normalize=False):
|
|||
# The only way we get this far is if a UnicodeDecodeError was
|
||||
# raised, otherwise we would have already returned (or raised some
|
||||
# other exception).
|
||||
raise exc
|
||||
raise exc # pylint: disable=raising-bad-type
|
||||
raise TypeError('expected str or bytearray')
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue