Skip pylint false-positives

This commit is contained in:
Erik Johnson 2018-08-06 06:26:37 -05:00
parent f14f4dae22
commit 53ba10ad5f
No known key found for this signature in database
GPG key ID: 5E5583C437808F3F

View file

@ -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')