Merge pull request #46219 from twangboy/win_fix_inet_pton

Fix `unit.modules.test_network` for Windows
This commit is contained in:
Nicole Thomas 2018-02-28 10:45:01 -05:00 committed by GitHub
commit 3da5dcb313
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -37,7 +37,7 @@ def inet_pton(address_family, ip_string):
# This will catch IP Addresses such as 10.1.2
if address_family == socket.AF_INET:
try:
ipaddress.ip_address(six.u(ip_string))
ipaddress.ip_address(six.text_type(ip_string))
except ValueError:
raise socket.error('illegal IP address string passed to inet_pton')
return socket.inet_aton(ip_string)