Use socket.inet_aton for isIPV4 since Windows doesn't (always?) have inet_pton

Closes: Sf#3430008
Signed-off-by: James McCoy <jamessan@users.sourceforge.net>

Conflicts:

	src/utils/net.py
This commit is contained in:
James McCoy 2011-12-05 22:48:09 -05:00 committed by Valentin Lorentz
parent 78accda006
commit d1df9e8306

View File

@ -114,10 +114,7 @@ def isIPV4(s):
0
"""
try:
try:
return bool(socket.inet_pton(socket.AF_INET, s))
except AttributeError: # Running Windows.
return bool(socket.inet_aton(s))
return bool(socket.inet_aton(s))
except socket.error:
return False