Cyril Jaquier 2005-08-17 19:26:49 +00:00
parent daf35a3535
commit c5c90b182a
1 changed files with 2 additions and 1 deletions

View File

@ -58,8 +58,9 @@ def searchIP(text):
def isValidIP(str):
""" Return true if str is a valid IP
"""
s = str.split('/', 1)
try:
socket.inet_aton(str)
socket.inet_aton(s[0])
return True
except socket.error:
return False