Commit 39d1744a authored by Iustin Pop's avatar Iustin Pop
Browse files

Fix usage of errors.ResolverError



This exception is documented to have three arguments, but in one case
we raise it with a simple string argument. Let's fix that.
Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
parent 012f9bc3
......@@ -229,7 +229,12 @@ class Hostname:
try:
return result[0][4][0]
except IndexError, err:
raise errors.ResolverError("Unknown error in getaddrinfo(): %s" % err)
# we don't have here an actual error code, it's just that the
# data type returned by getaddrinfo is not what we expected;
# let's keep the same format in the exception arguments with a
# dummy error code
raise errors.ResolverError(hostname, 0,
"Unknown error in getaddrinfo(): %s" % err)
@classmethod
def GetNormalizedName(cls, hostname):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment