mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-10-06 19:38:50 +02:00
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:
parent
78accda006
commit
d1df9e8306
@ -114,10 +114,7 @@ def isIPV4(s):
|
|||||||
0
|
0
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
try:
|
return bool(socket.inet_aton(s))
|
||||||
return bool(socket.inet_pton(socket.AF_INET, s))
|
|
||||||
except AttributeError: # Running Windows.
|
|
||||||
return bool(socket.inet_aton(s))
|
|
||||||
except socket.error:
|
except socket.error:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user