mirror of
https://github.com/python/cpython
synced 2024-09-20 11:41:43 +00:00
Merge 3.5 (asyncio)
This commit is contained in:
commit
642afb3d3d
|
@ -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)
|
||||
|
|
|
@ -130,6 +130,10 @@ def test_port_parameter_types(self):
|
|||
(INET, STREAM, TCP, '', ('1.2.3.4', 0)),
|
||||
base_events._ipaddr_info('1.2.3.4', None, INET, STREAM, TCP))
|
||||
|
||||
self.assertEqual(
|
||||
(INET, STREAM, TCP, '', ('1.2.3.4', 0)),
|
||||
base_events._ipaddr_info('1.2.3.4', b'', INET, STREAM, TCP))
|
||||
|
||||
self.assertEqual(
|
||||
(INET, STREAM, TCP, '', ('1.2.3.4', 0)),
|
||||
base_events._ipaddr_info('1.2.3.4', '', INET, STREAM, TCP))
|
||||
|
|
Loading…
Reference in a new issue