Skip to content

Commit

Permalink
Change Response.render content argument typing (#2264)
Browse files Browse the repository at this point in the history
  • Loading branch information
aminalaee authored Sep 1, 2023
1 parent cb6d284 commit bc7d095
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions starlette/responses.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ def __init__(
self.body = self.render(content)
self.init_headers(headers)

def render(self, content: typing.Union[str, bytes, None]) -> bytes:
def render(self, content: typing.Any) -> bytes:
if content is None:
return b""
if isinstance(content, bytes):
return content
return content.encode(self.charset)
return content.encode(self.charset) # type: ignore

def init_headers(
self, headers: typing.Optional[typing.Mapping[str, str]] = None
Expand Down

0 comments on commit bc7d095

Please sign in to comment.