Skip to content

Commit

Permalink
fix mypy
Browse files Browse the repository at this point in the history
  • Loading branch information
trim21 committed May 31, 2024
1 parent f1fee53 commit 0e4bacd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions httpx/_urlparse.py
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ def PERCENT(string: str) -> str:
return "".join([f"%{byte:02X}" for byte in string.encode("utf-8")])


def percent_encoded(string: str, safe: str = "/") -> str:
def percent_encoded(string: str | bytes, safe: str = "/") -> str:
"""
Use percent-encoding to quote a string.
"""
Expand Down Expand Up @@ -471,7 +471,7 @@ def quote(string: str, safe: str = "/") -> str:
return "".join(parts)


def urlencode(items: list[tuple[str, str]]) -> str:
def urlencode(items: list[tuple[str, str | bytes]]) -> str:
"""
We can use a much simpler version of the stdlib urlencode here because
we don't need to handle a bunch of different typing cases, such as bytes vs str.
Expand Down

0 comments on commit 0e4bacd

Please sign in to comment.