diff options
author | Atsuo Ishimoto <ishimoto@gembook.org> | 2012-07-16 06:16:54 (GMT) |
---|---|---|
committer | Atsuo Ishimoto <ishimoto@gembook.org> | 2012-07-16 06:16:54 (GMT) |
commit | da0fc14d46a174b921ea0f68e7996bf1cda9b95d (patch) | |
tree | 86bd82e21bbe4bd0fc68ea5bc8b14d1a0a51fcf6 /Lib/test/test_socket.py | |
parent | 29828a6fa9a7d42b1f2383860d37cdf7d9e74d49 (diff) | |
download | cpython-da0fc14d46a174b921ea0f68e7996bf1cda9b95d.zip cpython-da0fc14d46a174b921ea0f68e7996bf1cda9b95d.tar.gz cpython-da0fc14d46a174b921ea0f68e7996bf1cda9b95d.tar.bz2 |
Issue #7171: Add Windows implementation of ``inet_ntop`` and ``inet_pton`` to socket module.
Diffstat (limited to 'Lib/test/test_socket.py')
-rw-r--r-- | Lib/test/test_socket.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py index beff31a..eb8619f 100644 --- a/Lib/test/test_socket.py +++ b/Lib/test/test_socket.py @@ -980,6 +980,14 @@ class GeneralModuleTests(unittest.TestCase): return except ImportError: return + + if sys.platform == "win32": + try: + inet_pton(AF_INET6, '::') + except OSError as e: + if e.winerror == 10022: + return # IPv6 might not be installed on this PC + f = lambda a: inet_pton(AF_INET6, a) assertInvalid = lambda a: self.assertRaises( (OSError, ValueError), f, a @@ -1058,6 +1066,14 @@ class GeneralModuleTests(unittest.TestCase): return except ImportError: return + + if sys.platform == "win32": + try: + inet_ntop(AF_INET6, b'\x00' * 16) + except OSError as e: + if e.winerror == 10022: + return # IPv6 might not be installed on this PC + f = lambda a: inet_ntop(AF_INET6, a) assertInvalid = lambda a: self.assertRaises( (OSError, ValueError), f, a |