mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
Issue #7171: Add Windows implementation of `inet_ntop
and
inet_pton
` to socket module.
This commit is contained in:
parent
29828a6fa9
commit
da0fc14d46
3 changed files with 124 additions and 4 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue