def resolve(self, hostname):
"""
Resolve a hostname by looking it up in the C{names} dictionary.
"""
try:
return defer.succeed(self.names[hostname])
except KeyError:
return defer.fail(
DNSLookupError(
"FakeResolverReactor couldn't find {}".format(hostname)
)
)
评论列表
文章目录