Flake8: Comply with new E722 rule.

This commit is contained in:
Waylan Limberg
2017-10-25 14:27:53 -04:00
parent 54a24ea89f
commit 886e0074d0

View File

@@ -201,12 +201,12 @@ class IpAddress(OptionallyRequired):
def run_validation(self, value):
try:
host, port = value.rsplit(':', 1)
except:
except Exception:
raise ValidationError("Must be a string of format 'IP:PORT'")
try:
port = int(port)
except:
except Exception:
raise ValidationError("'{0}' is not a valid port".format(port))
class Address(namedtuple('Address', 'host port')):