Skip to content

Commit a6eeae3

Browse files
committed
fix convert_unspecified_to_localhost pytype check error
1 parent cbef7cc commit a6eeae3

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

aiosmtpd/controller.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,14 @@ def is_unspecified_address(address: str) -> bool:
8888
@public
8989
def convert_unspecified_to_localhost(
9090
address: str
91-
) -> Literal["::1", "127.0.0.1"]:
91+
) -> str:
92+
localhost = get_localhost()
9293
address_dict = {
93-
"": get_localhost(),
94+
"": localhost,
9495
"0.0.0.0": "127.0.0.1", # nosec
9596
"::": "::1", # nosec
9697
}
97-
return address_dict.get(address, get_localhost())
98+
return str(address_dict.get(address, localhost))
9899

99100

100101
class _FakeServer(asyncio.StreamReaderProtocol):

0 commit comments

Comments
 (0)