summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYury Selivanov <yselivanov@sprymix.com>2016-06-02 16:44:10 -0400
committerYury Selivanov <yselivanov@sprymix.com>2016-06-02 16:44:10 -0400
commit642afb3d3dcb5bcd359047d396343a1b3ca8370b (patch)
tree3b8d1cc8704e833b3aebc5fe397017e0febe2fa3
parentfddf12198fa43d411abb232c3ce8e97290717bfb (diff)
parenta8f895f051588cc5186650f13118b0149ae7e3d5 (diff)
downloadcpython-git-642afb3d3dcb5bcd359047d396343a1b3ca8370b.tar.gz
Merge 3.5 (asyncio)
-rw-r--r--Lib/asyncio/base_events.py2
-rw-r--r--Lib/test/test_asyncio/test_base_events.py4
2 files changed, 5 insertions, 1 deletions
diff --git a/Lib/asyncio/base_events.py b/Lib/asyncio/base_events.py
index cb845d9aad..41dd681ef4 100644
--- a/Lib/asyncio/base_events.py
+++ b/Lib/asyncio/base_events.py
@@ -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)
diff --git a/Lib/test/test_asyncio/test_base_events.py b/Lib/test/test_asyncio/test_base_events.py
index 678ba30e39..81c35c89c1 100644
--- a/Lib/test/test_asyncio/test_base_events.py
+++ b/Lib/test/test_asyncio/test_base_events.py
@@ -132,6 +132,10 @@ class BaseEventTests(test_utils.TestCase):
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))
self.assertEqual(