mirror of
https://github.com/python/cpython.git
synced 2025-08-02 16:13:13 +00:00
bpo-37199: Fix test failures when IPv6 is unavailable or disabled (GH-14480)
(cherry picked from commit c2cda638d6
)
Co-authored-by: Zackery Spytz <zspytz@gmail.com>
This commit is contained in:
parent
bf8cb31803
commit
c2684c6d62
5 changed files with 21 additions and 4 deletions
|
@ -673,7 +673,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'),
|
||||
|
@ -754,7 +754,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