Skip to content

Commit

Permalink
More linter fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshMock committed Aug 31, 2023
1 parent 0757a53 commit 19c7fd7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions elastic_transport/client_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,15 +138,15 @@ def to_str(
) -> str:
if isinstance(value, bytes):
return value.decode(encoding, errors)
return value # type: ignore[return-value]
return value


def to_bytes(
value: Union[str, bytes], encoding: str = "utf-8", errors: str = "strict"
) -> bytes:
if isinstance(value, str):
return value.encode(encoding, errors)
return value # type: ignore[return-value]
return value


# Python 3.7 added '~' to the safe list for urllib.parse.quote()
Expand Down

0 comments on commit 19c7fd7

Please sign in to comment.