asyncio: Support host=b'' for getaddrinfo

This commit is contained in:
Yury Selivanov 2016-06-02 16:43:52 -04:00
parent 6a8e626a60
commit a8f895f051
2 changed files with 5 additions and 1 deletions

View file

@ -102,7 +102,7 @@ def _ipaddr_info(host, port, family, type, proto):
else:
return None
if port in {None, ''}:
if port in {None, '', b''}:
port = 0
elif isinstance(port, (bytes, str)):
port = int(port)