Skip to content

Commit

Permalink
fix convert_unspecified_to_localhost pytype check error
Browse files Browse the repository at this point in the history
  • Loading branch information
wevsty committed Jun 16, 2021
1 parent cbef7cc commit a6eeae3
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions aiosmtpd/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,14 @@ def is_unspecified_address(address: str) -> bool:
@public
def convert_unspecified_to_localhost(
address: str
) -> Literal["::1", "127.0.0.1"]:
) -> str:
localhost = get_localhost()
address_dict = {
"": get_localhost(),
"": localhost,
"0.0.0.0": "127.0.0.1", # nosec
"::": "::1", # nosec
}
return address_dict.get(address, get_localhost())
return str(address_dict.get(address, localhost))


class _FakeServer(asyncio.StreamReaderProtocol):
Expand Down

0 comments on commit a6eeae3

Please sign in to comment.