diff options
author | Zackery Spytz <zspytz@gmail.com> | 2019-06-30 15:24:43 (GMT) |
---|---|---|
committer | Andrew Svetlov <andrew.svetlov@gmail.com> | 2019-06-30 15:24:43 (GMT) |
commit | c2cda638d63b98f5cf9a8ef13e15aace2b7e3f0b (patch) | |
tree | ed96b086ade6f8a2b2c3b589918636d450f64ad3 /Lib/test/test_ssl.py | |
parent | 0d671c04c39b52e44597491b893eb0b6c86b3d45 (diff) | |
download | cpython-c2cda638d63b98f5cf9a8ef13e15aace2b7e3f0b.zip cpython-c2cda638d63b98f5cf9a8ef13e15aace2b7e3f0b.tar.gz cpython-c2cda638d63b98f5cf9a8ef13e15aace2b7e3f0b.tar.bz2 |
bpo-37199: Fix test failures when IPv6 is unavailable or disabled (#14480)
Diffstat (limited to 'Lib/test/test_ssl.py')
-rw-r--r-- | Lib/test/test_ssl.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py index c72a857..064f0e8 100644 --- a/Lib/test/test_ssl.py +++ b/Lib/test/test_ssl.py @@ -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)) |