

def query(self, host, qtype):
    try:
        qtype = query_type_map[qtype]
    except KeyError:
        raise ValueError('invalid query type: {}'.format(qtype))
    fut = asyncio.Future(loop=self.loop)

    def cb(result, errorno):
        if fut.cancelled():
            return
        if (errorno is not None):
            fut.set_exception(error.DNSError(errorno, pycares.errno.strerror(errorno)))
        else:
            fut.set_result(result)
    self._channel.query(host, qtype, cb)
    return self

dataset/ETHPy150Open saghul/aiodns/aiodns/__init__.py DNSResolver.query/VarMisuse@138/176 `fut`->`self`