Commit 81319a81 authored by Zackery Spytz's avatar Zackery Spytz Committed by Benjamin Peterson

bpo-37199: Replace the early returns added in c2cda638. (GH-14535)

parent f3095b0b
...@@ -91,9 +91,7 @@ class BaseEventTests(test_utils.TestCase): ...@@ -91,9 +91,7 @@ class BaseEventTests(test_utils.TestCase):
self.assertIsNone( self.assertIsNone(
base_events._ipaddr_info('1.2.3.4', 1, UNSPEC, 0, 0)) base_events._ipaddr_info('1.2.3.4', 1, UNSPEC, 0, 0))
if not support.IPV6_ENABLED: if support.IPV6_ENABLED:
return
# IPv4 address with family IPv6. # IPv4 address with family IPv6.
self.assertIsNone( self.assertIsNone(
base_events._ipaddr_info('1.2.3.4', 1, INET6, STREAM, TCP)) base_events._ipaddr_info('1.2.3.4', 1, INET6, STREAM, TCP))
...@@ -1284,15 +1282,14 @@ class BaseEventLoopWithSelectorTests(test_utils.TestCase): ...@@ -1284,15 +1282,14 @@ class BaseEventLoopWithSelectorTests(test_utils.TestCase):
t.close() t.close()
test_utils.run_briefly(self.loop) # allow transport to close test_utils.run_briefly(self.loop) # allow transport to close
if not support.IPV6_ENABLED: if support.IPV6_ENABLED:
return
sock.family = socket.AF_INET6 sock.family = socket.AF_INET6
coro = self.loop.create_connection(asyncio.Protocol, '::1', 80) coro = self.loop.create_connection(asyncio.Protocol, '::1', 80)
t, p = self.loop.run_until_complete(coro) t, p = self.loop.run_until_complete(coro)
try: try:
# Without inet_pton we use getaddrinfo, which transforms ('::1', 80) # Without inet_pton we use getaddrinfo, which transforms
# to ('::1', 80, 0, 0). The last 0s are flow info, scope id. # ('::1', 80) to ('::1', 80, 0, 0). The last 0s are flow info,
# scope id.
[address] = sock.connect.call_args[0] [address] = sock.connect.call_args[0]
host, port = address[:2] host, port = address[:2]
self.assertRegex(host, r'::(0\.)*1') self.assertRegex(host, r'::(0\.)*1')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment