Merge "Avoid catching generic exception"

This commit is contained in:
Jenkins 2016-06-09 08:05:40 +00:00 committed by Gerrit Code Review
commit 6439ee0ab5
1 changed files with 2 additions and 2 deletions

View File

@ -92,7 +92,7 @@ def is_valid_ipv4(address):
"""
try:
return netaddr.valid_ipv4(address)
except Exception:
except netaddr.AddrFormatError:
return False
@ -107,7 +107,7 @@ def is_valid_ipv6(address):
"""
try:
return netaddr.valid_ipv6(address)
except Exception:
except netaddr.AddrFormatError:
return False