mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
bpo-37199: Fix test failures when IPv6 is unavailable or disabled (#14480)
This commit is contained in:
parent
0d671c04c3
commit
c2cda638d6
5 changed files with 21 additions and 4 deletions
|
@ -676,7 +676,7 @@ class BasicSocketTests(unittest.TestCase):
|
|||
fail(cert, 'example.net')
|
||||
|
||||
# -- IPv6 matching --
|
||||
if hasattr(socket, 'AF_INET6'):
|
||||
if support.IPV6_ENABLED:
|
||||
cert = {'subject': ((('commonName', 'example.com'),),),
|
||||
'subjectAltName': (
|
||||
('DNS', 'example.com'),
|
||||
|
@ -757,7 +757,7 @@ class BasicSocketTests(unittest.TestCase):
|
|||
ssl._inet_paton(invalid)
|
||||
for ipaddr in ['127.0.0.1', '192.168.0.1']:
|
||||
self.assertTrue(ssl._inet_paton(ipaddr))
|
||||
if hasattr(socket, 'AF_INET6'):
|
||||
if support.IPV6_ENABLED:
|
||||
for ipaddr in ['::1', '2001:db8:85a3::8a2e:370:7334']:
|
||||
self.assertTrue(ssl._inet_paton(ipaddr))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue