Use socket.error instead of non-existent socket.Error (#43499)

This commit is contained in:
joren485 2018-08-01 16:24:31 +02:00 committed by Nathaniel Case
parent 9169daa326
commit 6d680d8281

View file

@ -3580,7 +3580,7 @@ def validateValueAgainstRule(ruleString, variableValue):
try:
socket.inet_pton(socket.AF_INET, variableValue)
result = True
except socket.Error:
except socket.error:
result = False
if(result is True):
return "ok"
@ -3598,7 +3598,7 @@ def validateValueAgainstRule(ruleString, variableValue):
result = True
else:
result = False
except socket.Error:
except socket.error:
result = False
if(result is True):
return "ok"
@ -3609,7 +3609,7 @@ def validateValueAgainstRule(ruleString, variableValue):
try:
socket.inet_pton(socket.AF_INET6, variableValue)
result = True
except socket.Error:
except socket.error:
result = False
if(result is True):
return "ok"