Generated by Cython 3.0.0a9

Yellow lines hint at Python interaction.
Click on a line that starts with a "`+`" to see the C code that Cython generated for it.

Raw output: cares.c

    +001: # Copyright (c) 2011-2012 Denis Bilenko. See LICENSE for details.

      __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

     002: # Automatic pickling of cdef classes was added in 0.26. Unfortunately it

     003: # seems to be buggy (at least for the `result` class) and produces code that

     004: # can't compile ("local variable 'result' referenced before assignment").

     005: # See https://github.com/cython/cython/issues/1786

     006: # cython: auto_pickle=False,language_level=3str

     007: cimport libcares as cares

    +008: import sys

      __pyx_t_1 = __Pyx_ImportDottedModule(__pyx_n_s_sys, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 8, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_1) < 0) __PYX_ERR(0, 8, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

     009:

     010: from cpython.version cimport PY_MAJOR_VERSION

     011: from cpython.tuple cimport PyTuple_Check

     012: from cpython.getargs cimport PyArg_ParseTuple

     013: from cpython.ref cimport Py_INCREF

     014: from cpython.ref cimport Py_DECREF

     015: from cpython.mem cimport PyMem_Malloc

     016: from cpython.mem cimport PyMem_Free

     017: from libc.string cimport memset

     018:

    +019: from gevent._compat import MAC

      __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 19, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_n_s_MAC);
      __Pyx_GIVEREF(__pyx_n_s_MAC);
      PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_MAC);
      __pyx_t_2 = __Pyx_Import(__pyx_n_s_gevent__compat, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 19, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_MAC); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 19, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_MAC, __pyx_t_1) < 0) __PYX_ERR(0, 19, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

     020:

    +021: import _socket

      __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_socket, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 21, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_socket, __pyx_t_2) < 0) __PYX_ERR(0, 21, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    +022: from _socket import gaierror

      __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 22, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_n_s_gaierror);
      __Pyx_GIVEREF(__pyx_n_s_gaierror);
      PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_gaierror);
      __pyx_t_1 = __Pyx_Import(__pyx_n_s_socket, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 22, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_gaierror); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 22, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_gaierror, __pyx_t_2) < 0) __PYX_ERR(0, 22, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    +023: from _socket import herror

      __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 23, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_n_s_herror);
      __Pyx_GIVEREF(__pyx_n_s_herror);
      PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_herror);
      __pyx_t_2 = __Pyx_Import(__pyx_n_s_socket, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 23, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_herror); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 23, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_herror, __pyx_t_1) < 0) __PYX_ERR(0, 23, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

     024:

     025:

    +026: __all__ = ['channel']

      __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 26, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_n_s_channel);
      __Pyx_GIVEREF(__pyx_n_s_channel);
      PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_channel);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_2) < 0) __PYX_ERR(0, 26, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

     027:

     028: cdef tuple string_types

     029: cdef type text_type

     030:

    +031: if PY_MAJOR_VERSION >= 3:

      __pyx_t_3 = ((PY_MAJOR_VERSION >= 3) != 0);
      if (__pyx_t_3) {
    /* … */
        goto __pyx_L2;
      }

    +032:     string_types = str,

        __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 32, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_INCREF((PyObject *)(&PyString_Type));
        __Pyx_GIVEREF((PyObject *)(&PyString_Type));
        PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)(&PyString_Type)));
        __Pyx_XGOTREF(__pyx_v_6gevent_8resolver_5cares_string_types);
        __Pyx_DECREF_SET(__pyx_v_6gevent_8resolver_5cares_string_types, ((PyObject*)__pyx_t_2));
        __Pyx_GIVEREF(__pyx_t_2);
        __pyx_t_2 = 0;

    +033:     text_type = str

        __Pyx_INCREF((PyObject *)(&PyString_Type));
        __Pyx_XGOTREF((PyObject *)__pyx_v_6gevent_8resolver_5cares_text_type);
        __Pyx_DECREF_SET(__pyx_v_6gevent_8resolver_5cares_text_type, (&PyString_Type));
        __Pyx_GIVEREF((PyObject *)(&PyString_Type));

     034: else:

    +035:     string_types = __builtins__.basestring,

      /*else*/ {
        __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_builtins); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 35, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_basestring); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 35, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 35, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_GIVEREF(__pyx_t_1);
        PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
        __pyx_t_1 = 0;
        __Pyx_XGOTREF(__pyx_v_6gevent_8resolver_5cares_string_types);
        __Pyx_DECREF_SET(__pyx_v_6gevent_8resolver_5cares_string_types, ((PyObject*)__pyx_t_2));
        __Pyx_GIVEREF(__pyx_t_2);
        __pyx_t_2 = 0;

    +036:     text_type = __builtins__.unicode

        __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_builtins); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 36, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 36, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (!(likely(PyType_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("type", __pyx_t_1))) __PYX_ERR(0, 36, __pyx_L1_error)
        __Pyx_XGOTREF((PyObject *)__pyx_v_6gevent_8resolver_5cares_text_type);
        __Pyx_DECREF_SET(__pyx_v_6gevent_8resolver_5cares_text_type, ((PyTypeObject*)__pyx_t_1));
        __Pyx_GIVEREF(__pyx_t_1);
        __pyx_t_1 = 0;
      }
      __pyx_L2:;

     037:

     038: DEF TIMEOUT = 1

     039:

     040: DEF EV_READ = 1

     041: DEF EV_WRITE = 2

     042:

     043: cdef extern from *:

     044:     """

     045: #ifdef CARES_EMBED

     046: #include "ares_setup.h"

     047: #endif

     048:

     049: #ifdef HAVE_NETDB_H

     050: #include <netdb.h>

     051: #endif

     052:

     053:     #ifndef EAI_ADDRFAMILY

     054:     #define EAI_ADDRFAMILY -1

     055:     #endif

     056:

     057:     #ifndef EAI_BADHINTS

     058:     #define EAI_BADHINTS -2

     059:     #endif

     060:

     061:     #ifndef EAI_NODATA

     062:     #define EAI_NODATA -3

     063:     #endif

     064:

     065:     #ifndef EAI_OVERFLOW

     066:     #define EAI_OVERFLOW -4

     067:     #endif

     068:

     069:     #ifndef EAI_PROTOCOL

     070:     #define EAI_PROTOCOL -5

     071:     #endif

     072:

     073:     #ifndef EAI_SYSTEM

     074:     #define EAI_SYSTEM

     075:     #endif

     076:

     077:     """

     078:

     079: cdef extern from "ares.h":

     080:     int AF_INET

     081:     int AF_INET6

     082:     int INET6_ADDRSTRLEN

     083:

     084:     struct hostent:

     085:         char* h_name

     086:         int h_addrtype

     087:         char** h_aliases

     088:         char** h_addr_list

     089:

     090:     struct sockaddr_t "sockaddr":

     091:         pass

     092:

     093:     struct ares_channeldata:

     094:         pass

     095:

     096:     struct in_addr:

     097:         unsigned int s_addr

     098:

     099:     struct sockaddr_in:

     100:         int sin_family

     101:         int sin_port

     102:         in_addr sin_addr

     103:

     104:     struct in6_addr:

     105:         char s6_addr[16]

     106:

     107:     struct sockaddr_in6:

     108:         int sin6_family

     109:         int sin6_port

     110:         unsigned int sin6_flowinfo

     111:         in6_addr sin6_addr

     112:         unsigned int sin6_scope_id

     113:

     114:

     115:     unsigned int htons(unsigned int hostshort)

     116:     unsigned int ntohs(unsigned int hostshort)

     117:     unsigned int htonl(unsigned int hostlong)

     118:     unsigned int ntohl(unsigned int hostlong)

     119:

    +120: cdef int AI_NUMERICSERV = _socket.AI_NUMERICSERV

      __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_socket); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 120, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_AI_NUMERICSERV); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 120, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 120, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_6gevent_8resolver_5cares_AI_NUMERICSERV = __pyx_t_4;

    +121: cdef int AI_CANONNAME = _socket.AI_CANONNAME

      __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_socket); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 121, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_AI_CANONNAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 121, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 121, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_6gevent_8resolver_5cares_AI_CANONNAME = __pyx_t_4;

    +122: cdef int NI_NUMERICHOST = _socket.NI_NUMERICHOST

      __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_socket); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 122, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_NI_NUMERICHOST); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 122, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 122, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_6gevent_8resolver_5cares_NI_NUMERICHOST = __pyx_t_4;

    +123: cdef int NI_NUMERICSERV = _socket.NI_NUMERICSERV

      __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_socket); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 123, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_NI_NUMERICSERV); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 123, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 123, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_6gevent_8resolver_5cares_NI_NUMERICSERV = __pyx_t_4;

    +124: cdef int NI_NOFQDN = _socket.NI_NOFQDN

      __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_socket); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 124, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_NI_NOFQDN); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 124, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 124, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_6gevent_8resolver_5cares_NI_NOFQDN = __pyx_t_4;

    +125: cdef int NI_NAMEREQD = _socket.NI_NAMEREQD

      __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_socket); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 125, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_NI_NAMEREQD); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 125, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 125, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_6gevent_8resolver_5cares_NI_NAMEREQD = __pyx_t_4;

    +126: cdef int NI_DGRAM = _socket.NI_DGRAM

      __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_socket); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 126, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_NI_DGRAM); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 126, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 126, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_6gevent_8resolver_5cares_NI_DGRAM = __pyx_t_4;

     127:

     128:

    +129: cdef dict _ares_errors = dict([

      __pyx_t_2 = PyList_New(26); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 129, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_1);
      PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_5);
      PyList_SET_ITEM(__pyx_t_2, 1, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_6);
      PyList_SET_ITEM(__pyx_t_2, 2, __pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_7);
      PyList_SET_ITEM(__pyx_t_2, 3, __pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_8);
      PyList_SET_ITEM(__pyx_t_2, 4, __pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_9);
      PyList_SET_ITEM(__pyx_t_2, 5, __pyx_t_9);
      __Pyx_GIVEREF(__pyx_t_10);
      PyList_SET_ITEM(__pyx_t_2, 6, __pyx_t_10);
      __Pyx_GIVEREF(__pyx_t_11);
      PyList_SET_ITEM(__pyx_t_2, 7, __pyx_t_11);
      __Pyx_GIVEREF(__pyx_t_12);
      PyList_SET_ITEM(__pyx_t_2, 8, __pyx_t_12);
      __Pyx_GIVEREF(__pyx_t_13);
      PyList_SET_ITEM(__pyx_t_2, 9, __pyx_t_13);
      __Pyx_GIVEREF(__pyx_t_14);
      PyList_SET_ITEM(__pyx_t_2, 10, __pyx_t_14);
      __Pyx_GIVEREF(__pyx_t_15);
      PyList_SET_ITEM(__pyx_t_2, 11, __pyx_t_15);
      __Pyx_GIVEREF(__pyx_t_16);
      PyList_SET_ITEM(__pyx_t_2, 12, __pyx_t_16);
      __Pyx_GIVEREF(__pyx_t_17);
      PyList_SET_ITEM(__pyx_t_2, 13, __pyx_t_17);
      __Pyx_GIVEREF(__pyx_t_18);
      PyList_SET_ITEM(__pyx_t_2, 14, __pyx_t_18);
      __Pyx_GIVEREF(__pyx_t_19);
      PyList_SET_ITEM(__pyx_t_2, 15, __pyx_t_19);
      __Pyx_GIVEREF(__pyx_t_20);
      PyList_SET_ITEM(__pyx_t_2, 16, __pyx_t_20);
      __Pyx_GIVEREF(__pyx_t_21);
      PyList_SET_ITEM(__pyx_t_2, 17, __pyx_t_21);
      __Pyx_GIVEREF(__pyx_t_22);
      PyList_SET_ITEM(__pyx_t_2, 18, __pyx_t_22);
      __Pyx_GIVEREF(__pyx_t_23);
      PyList_SET_ITEM(__pyx_t_2, 19, __pyx_t_23);
      __Pyx_GIVEREF(__pyx_t_24);
      PyList_SET_ITEM(__pyx_t_2, 20, __pyx_t_24);
      __Pyx_GIVEREF(__pyx_t_25);
      PyList_SET_ITEM(__pyx_t_2, 21, __pyx_t_25);
      __Pyx_GIVEREF(__pyx_t_26);
      PyList_SET_ITEM(__pyx_t_2, 22, __pyx_t_26);
      __Pyx_GIVEREF(__pyx_t_27);
      PyList_SET_ITEM(__pyx_t_2, 23, __pyx_t_27);
      __Pyx_GIVEREF(__pyx_t_28);
      PyList_SET_ITEM(__pyx_t_2, 24, __pyx_t_28);
      __Pyx_GIVEREF(__pyx_t_29);
      PyList_SET_ITEM(__pyx_t_2, 25, __pyx_t_29);
      __pyx_t_1 = 0;
      __pyx_t_5 = 0;
      __pyx_t_6 = 0;
      __pyx_t_7 = 0;
      __pyx_t_8 = 0;
      __pyx_t_9 = 0;
      __pyx_t_10 = 0;
      __pyx_t_11 = 0;
      __pyx_t_12 = 0;
      __pyx_t_13 = 0;
      __pyx_t_14 = 0;
      __pyx_t_15 = 0;
      __pyx_t_16 = 0;
      __pyx_t_17 = 0;
      __pyx_t_18 = 0;
      __pyx_t_19 = 0;
      __pyx_t_20 = 0;
      __pyx_t_21 = 0;
      __pyx_t_22 = 0;
      __pyx_t_23 = 0;
      __pyx_t_24 = 0;
      __pyx_t_25 = 0;
      __pyx_t_26 = 0;
      __pyx_t_27 = 0;
      __pyx_t_28 = 0;
      __pyx_t_29 = 0;
      __pyx_t_29 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyDict_Type)), __pyx_t_2); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 129, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_29);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XGOTREF(__pyx_v_6gevent_8resolver_5cares__ares_errors);
      __Pyx_DECREF_SET(__pyx_v_6gevent_8resolver_5cares__ares_errors, ((PyObject*)__pyx_t_29));
      __Pyx_GIVEREF(__pyx_t_29);
      __pyx_t_29 = 0;

    +130:     (cares.ARES_SUCCESS, 'ARES_SUCCESS'),

      __pyx_t_2 = __Pyx_PyInt_From_int(ARES_SUCCESS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 130, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 130, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
      __Pyx_INCREF(__pyx_n_s_ARES_SUCCESS);
      __Pyx_GIVEREF(__pyx_n_s_ARES_SUCCESS);
      PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_ARES_SUCCESS);
      __pyx_t_2 = 0;

     131:

    +132:     (cares.ARES_EADDRGETNETWORKPARAMS, 'ARES_EADDRGETNETWORKPARAMS'),

      __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EADDRGETNETWORKPARAMS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 132, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 132, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
      __Pyx_INCREF(__pyx_n_s_ARES_EADDRGETNETWORKPARAMS);
      __Pyx_GIVEREF(__pyx_n_s_ARES_EADDRGETNETWORKPARAMS);
      PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_n_s_ARES_EADDRGETNETWORKPARAMS);
      __pyx_t_2 = 0;

    +133:     (cares.ARES_EBADFAMILY, 'ARES_EBADFAMILY'),

      __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EBADFAMILY); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 133, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 133, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2);
      __Pyx_INCREF(__pyx_n_s_ARES_EBADFAMILY);
      __Pyx_GIVEREF(__pyx_n_s_ARES_EBADFAMILY);
      PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_n_s_ARES_EBADFAMILY);
      __pyx_t_2 = 0;

    +134:     (cares.ARES_EBADFLAGS, 'ARES_EBADFLAGS'),

      __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EBADFLAGS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 134, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 134, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2);
      __Pyx_INCREF(__pyx_n_s_ARES_EBADFLAGS);
      __Pyx_GIVEREF(__pyx_n_s_ARES_EBADFLAGS);
      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_n_s_ARES_EBADFLAGS);
      __pyx_t_2 = 0;

    +135:     (cares.ARES_EBADHINTS, 'ARES_EBADHINTS'),

      __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EBADHINTS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 135, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 135, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2);
      __Pyx_INCREF(__pyx_n_s_ARES_EBADHINTS);
      __Pyx_GIVEREF(__pyx_n_s_ARES_EBADHINTS);
      PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_n_s_ARES_EBADHINTS);
      __pyx_t_2 = 0;

    +136:     (cares.ARES_EBADNAME, 'ARES_EBADNAME'),

      __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EBADNAME); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 136, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 136, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_2);
      __Pyx_INCREF(__pyx_n_s_ARES_EBADNAME);
      __Pyx_GIVEREF(__pyx_n_s_ARES_EBADNAME);
      PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_n_s_ARES_EBADNAME);
      __pyx_t_2 = 0;

    +137:     (cares.ARES_EBADQUERY, 'ARES_EBADQUERY'),

      __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EBADQUERY); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 137, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 137, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_2);
      __Pyx_INCREF(__pyx_n_s_ARES_EBADQUERY);
      __Pyx_GIVEREF(__pyx_n_s_ARES_EBADQUERY);
      PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_n_s_ARES_EBADQUERY);
      __pyx_t_2 = 0;

    +138:     (cares.ARES_EBADRESP, 'ARES_EBADRESP'),

      __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EBADRESP); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 138, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 138, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_2);
      __Pyx_INCREF(__pyx_n_s_ARES_EBADRESP);
      __Pyx_GIVEREF(__pyx_n_s_ARES_EBADRESP);
      PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_n_s_ARES_EBADRESP);
      __pyx_t_2 = 0;

    +139:     (cares.ARES_EBADSTR, 'ARES_EBADSTR'),

      __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EBADSTR); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 139, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 139, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_2);
      __Pyx_INCREF(__pyx_n_s_ARES_EBADSTR);
      __Pyx_GIVEREF(__pyx_n_s_ARES_EBADSTR);
      PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_n_s_ARES_EBADSTR);
      __pyx_t_2 = 0;

    +140:     (cares.ARES_ECANCELLED, 'ARES_ECANCELLED'),

      __pyx_t_2 = __Pyx_PyInt_From_int(ARES_ECANCELLED); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 140, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_13 = PyTuple_New(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 140, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_2);
      __Pyx_INCREF(__pyx_n_s_ARES_ECANCELLED);
      __Pyx_GIVEREF(__pyx_n_s_ARES_ECANCELLED);
      PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_n_s_ARES_ECANCELLED);
      __pyx_t_2 = 0;

    +141:     (cares.ARES_ECONNREFUSED, 'ARES_ECONNREFUSED'),

      __pyx_t_2 = __Pyx_PyInt_From_int(ARES_ECONNREFUSED); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 141, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_14 = PyTuple_New(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 141, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_2);
      __Pyx_INCREF(__pyx_n_s_ARES_ECONNREFUSED);
      __Pyx_GIVEREF(__pyx_n_s_ARES_ECONNREFUSED);
      PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_n_s_ARES_ECONNREFUSED);
      __pyx_t_2 = 0;

    +142:     (cares.ARES_EDESTRUCTION, 'ARES_EDESTRUCTION'),

      __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EDESTRUCTION); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 142, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_15 = PyTuple_New(2); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 142, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_15);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_2);
      __Pyx_INCREF(__pyx_n_s_ARES_EDESTRUCTION);
      __Pyx_GIVEREF(__pyx_n_s_ARES_EDESTRUCTION);
      PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_n_s_ARES_EDESTRUCTION);
      __pyx_t_2 = 0;

    +143:     (cares.ARES_EFILE, 'ARES_EFILE'),

      __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EFILE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 143, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_16 = PyTuple_New(2); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 143, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_16);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_2);
      __Pyx_INCREF(__pyx_n_s_ARES_EFILE);
      __Pyx_GIVEREF(__pyx_n_s_ARES_EFILE);
      PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_n_s_ARES_EFILE);
      __pyx_t_2 = 0;

    +144:     (cares.ARES_EFORMERR, 'ARES_EFORMERR'),

      __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EFORMERR); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 144, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_17 = PyTuple_New(2); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 144, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_17);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_2);
      __Pyx_INCREF(__pyx_n_s_ARES_EFORMERR);
      __Pyx_GIVEREF(__pyx_n_s_ARES_EFORMERR);
      PyTuple_SET_ITEM(__pyx_t_17, 1, __pyx_n_s_ARES_EFORMERR);
      __pyx_t_2 = 0;

    +145:     (cares.ARES_ELOADIPHLPAPI, 'ARES_ELOADIPHLPAPI'),

      __pyx_t_2 = __Pyx_PyInt_From_int(ARES_ELOADIPHLPAPI); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 145, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_18 = PyTuple_New(2); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 145, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_18);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_2);
      __Pyx_INCREF(__pyx_n_s_ARES_ELOADIPHLPAPI);
      __Pyx_GIVEREF(__pyx_n_s_ARES_ELOADIPHLPAPI);
      PyTuple_SET_ITEM(__pyx_t_18, 1, __pyx_n_s_ARES_ELOADIPHLPAPI);
      __pyx_t_2 = 0;

    +146:     (cares.ARES_ENODATA, 'ARES_ENODATA'),

      __pyx_t_2 = __Pyx_PyInt_From_int(ARES_ENODATA); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 146, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_19 = PyTuple_New(2); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 146, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_19);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_2);
      __Pyx_INCREF(__pyx_n_s_ARES_ENODATA);
      __Pyx_GIVEREF(__pyx_n_s_ARES_ENODATA);
      PyTuple_SET_ITEM(__pyx_t_19, 1, __pyx_n_s_ARES_ENODATA);
      __pyx_t_2 = 0;

    +147:     (cares.ARES_ENOMEM, 'ARES_ENOMEM'),

      __pyx_t_2 = __Pyx_PyInt_From_int(ARES_ENOMEM); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 147, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_20 = PyTuple_New(2); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 147, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_20);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_2);
      __Pyx_INCREF(__pyx_n_s_ARES_ENOMEM);
      __Pyx_GIVEREF(__pyx_n_s_ARES_ENOMEM);
      PyTuple_SET_ITEM(__pyx_t_20, 1, __pyx_n_s_ARES_ENOMEM);
      __pyx_t_2 = 0;

    +148:     (cares.ARES_ENONAME, 'ARES_ENONAME'),

      __pyx_t_2 = __Pyx_PyInt_From_int(ARES_ENONAME); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 148, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_21 = PyTuple_New(2); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 148, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_21);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_21, 0, __pyx_t_2);
      __Pyx_INCREF(__pyx_n_s_ARES_ENONAME);
      __Pyx_GIVEREF(__pyx_n_s_ARES_ENONAME);
      PyTuple_SET_ITEM(__pyx_t_21, 1, __pyx_n_s_ARES_ENONAME);
      __pyx_t_2 = 0;

    +149:     (cares.ARES_ENOTFOUND, 'ARES_ENOTFOUND'),

      __pyx_t_2 = __Pyx_PyInt_From_int(ARES_ENOTFOUND); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 149, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_22 = PyTuple_New(2); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 149, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_22);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_22, 0, __pyx_t_2);
      __Pyx_INCREF(__pyx_n_s_ARES_ENOTFOUND);
      __Pyx_GIVEREF(__pyx_n_s_ARES_ENOTFOUND);
      PyTuple_SET_ITEM(__pyx_t_22, 1, __pyx_n_s_ARES_ENOTFOUND);
      __pyx_t_2 = 0;

    +150:     (cares.ARES_ENOTIMP, 'ARES_ENOTIMP'),

      __pyx_t_2 = __Pyx_PyInt_From_int(ARES_ENOTIMP); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 150, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_23 = PyTuple_New(2); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 150, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_23);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_23, 0, __pyx_t_2);
      __Pyx_INCREF(__pyx_n_s_ARES_ENOTIMP);
      __Pyx_GIVEREF(__pyx_n_s_ARES_ENOTIMP);
      PyTuple_SET_ITEM(__pyx_t_23, 1, __pyx_n_s_ARES_ENOTIMP);
      __pyx_t_2 = 0;

    +151:     (cares.ARES_ENOTINITIALIZED, 'ARES_ENOTINITIALIZED'),

      __pyx_t_2 = __Pyx_PyInt_From_int(ARES_ENOTINITIALIZED); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 151, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_24 = PyTuple_New(2); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 151, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_24);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_24, 0, __pyx_t_2);
      __Pyx_INCREF(__pyx_n_s_ARES_ENOTINITIALIZED);
      __Pyx_GIVEREF(__pyx_n_s_ARES_ENOTINITIALIZED);
      PyTuple_SET_ITEM(__pyx_t_24, 1, __pyx_n_s_ARES_ENOTINITIALIZED);
      __pyx_t_2 = 0;

    +152:     (cares.ARES_EOF, 'ARES_EOF'),

      __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EOF); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 152, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_25 = PyTuple_New(2); if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 152, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_25);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_25, 0, __pyx_t_2);
      __Pyx_INCREF(__pyx_n_s_ARES_EOF);
      __Pyx_GIVEREF(__pyx_n_s_ARES_EOF);
      PyTuple_SET_ITEM(__pyx_t_25, 1, __pyx_n_s_ARES_EOF);
      __pyx_t_2 = 0;

    +153:     (cares.ARES_EREFUSED, 'ARES_EREFUSED'),

      __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EREFUSED); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 153, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_26 = PyTuple_New(2); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 153, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_26);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_26, 0, __pyx_t_2);
      __Pyx_INCREF(__pyx_n_s_ARES_EREFUSED);
      __Pyx_GIVEREF(__pyx_n_s_ARES_EREFUSED);
      PyTuple_SET_ITEM(__pyx_t_26, 1, __pyx_n_s_ARES_EREFUSED);
      __pyx_t_2 = 0;

    +154:     (cares.ARES_ESERVICE, 'ARES_ESERVICE'),

      __pyx_t_2 = __Pyx_PyInt_From_int(ARES_ESERVICE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 154, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_27 = PyTuple_New(2); if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 154, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_27);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_27, 0, __pyx_t_2);
      __Pyx_INCREF(__pyx_n_s_ARES_ESERVICE);
      __Pyx_GIVEREF(__pyx_n_s_ARES_ESERVICE);
      PyTuple_SET_ITEM(__pyx_t_27, 1, __pyx_n_s_ARES_ESERVICE);
      __pyx_t_2 = 0;

    +155:     (cares.ARES_ESERVFAIL, 'ARES_ESERVFAIL'),

      __pyx_t_2 = __Pyx_PyInt_From_int(ARES_ESERVFAIL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 155, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_28 = PyTuple_New(2); if (unlikely(!__pyx_t_28)) __PYX_ERR(0, 155, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_28);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_28, 0, __pyx_t_2);
      __Pyx_INCREF(__pyx_n_s_ARES_ESERVFAIL);
      __Pyx_GIVEREF(__pyx_n_s_ARES_ESERVFAIL);
      PyTuple_SET_ITEM(__pyx_t_28, 1, __pyx_n_s_ARES_ESERVFAIL);
      __pyx_t_2 = 0;

    +156:     (cares.ARES_ETIMEOUT, 'ARES_ETIMEOUT'),

      __pyx_t_2 = __Pyx_PyInt_From_int(ARES_ETIMEOUT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 156, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_29 = PyTuple_New(2); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 156, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_29);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_29, 0, __pyx_t_2);
      __Pyx_INCREF(__pyx_n_s_ARES_ETIMEOUT);
      __Pyx_GIVEREF(__pyx_n_s_ARES_ETIMEOUT);
      PyTuple_SET_ITEM(__pyx_t_29, 1, __pyx_n_s_ARES_ETIMEOUT);
      __pyx_t_2 = 0;

     157: ])

     158:

     159: cdef dict _ares_to_gai_system = {

    +160:     cares.ARES_EBADFAMILY: cares.EAI_ADDRFAMILY,

      __pyx_t_29 = __Pyx_PyDict_NewPresized(9); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 160, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_29);
      __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EBADFAMILY); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 160, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_28 = __Pyx_PyInt_From_int(EAI_ADDRFAMILY); if (unlikely(!__pyx_t_28)) __PYX_ERR(0, 160, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_28);
      if (PyDict_SetItem(__pyx_t_29, __pyx_t_2, __pyx_t_28) < 0) __PYX_ERR(0, 160, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_28); __pyx_t_28 = 0;

    +161:     cares.ARES_EBADFLAGS:  cares.EAI_BADFLAGS,

      __pyx_t_28 = __Pyx_PyInt_From_int(ARES_EBADFLAGS); if (unlikely(!__pyx_t_28)) __PYX_ERR(0, 161, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_28);
      __pyx_t_2 = __Pyx_PyInt_From_int(EAI_BADFLAGS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 161, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_29, __pyx_t_28, __pyx_t_2) < 0) __PYX_ERR(0, 160, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_28); __pyx_t_28 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    +162:     cares.ARES_EBADHINTS:  cares.EAI_BADHINTS,

      __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EBADHINTS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 162, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_28 = __Pyx_PyInt_From_int(EAI_BADHINTS); if (unlikely(!__pyx_t_28)) __PYX_ERR(0, 162, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_28);
      if (PyDict_SetItem(__pyx_t_29, __pyx_t_2, __pyx_t_28) < 0) __PYX_ERR(0, 160, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_28); __pyx_t_28 = 0;

    +163:     cares.ARES_ENOMEM:     cares.EAI_MEMORY,

      __pyx_t_28 = __Pyx_PyInt_From_int(ARES_ENOMEM); if (unlikely(!__pyx_t_28)) __PYX_ERR(0, 163, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_28);
      __pyx_t_2 = __Pyx_PyInt_From_int(EAI_MEMORY); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 163, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_29, __pyx_t_28, __pyx_t_2) < 0) __PYX_ERR(0, 160, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_28); __pyx_t_28 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    +164:     cares.ARES_ENONAME:    cares.EAI_NONAME,

      __pyx_t_2 = __Pyx_PyInt_From_int(ARES_ENONAME); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 164, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_28 = __Pyx_PyInt_From_int(EAI_NONAME); if (unlikely(!__pyx_t_28)) __PYX_ERR(0, 164, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_28);
      if (PyDict_SetItem(__pyx_t_29, __pyx_t_2, __pyx_t_28) < 0) __PYX_ERR(0, 160, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_28); __pyx_t_28 = 0;

    +165:     cares.ARES_ENOTFOUND:  cares.EAI_NONAME,

      __pyx_t_28 = __Pyx_PyInt_From_int(ARES_ENOTFOUND); if (unlikely(!__pyx_t_28)) __PYX_ERR(0, 165, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_28);
      __pyx_t_2 = __Pyx_PyInt_From_int(EAI_NONAME); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 165, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_29, __pyx_t_28, __pyx_t_2) < 0) __PYX_ERR(0, 160, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_28); __pyx_t_28 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    +166:     cares.ARES_ENOTIMP:    cares.EAI_FAMILY,

      __pyx_t_2 = __Pyx_PyInt_From_int(ARES_ENOTIMP); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 166, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_28 = __Pyx_PyInt_From_int(EAI_FAMILY); if (unlikely(!__pyx_t_28)) __PYX_ERR(0, 166, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_28);
      if (PyDict_SetItem(__pyx_t_29, __pyx_t_2, __pyx_t_28) < 0) __PYX_ERR(0, 160, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_28); __pyx_t_28 = 0;

     167:     # While EAI_NODATA ("No address associated with nodename") might

     168:     # seem to be the natural mapping, typical resolvers actually

     169:     # return EAI_NONAME in that same situation; I've yet to find EAI_NODATA

     170:     # in a test.

    +171:     cares.ARES_ENODATA:    cares.EAI_NONAME,

      __pyx_t_28 = __Pyx_PyInt_From_int(ARES_ENODATA); if (unlikely(!__pyx_t_28)) __PYX_ERR(0, 171, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_28);
      __pyx_t_2 = __Pyx_PyInt_From_int(EAI_NONAME); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 171, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_29, __pyx_t_28, __pyx_t_2) < 0) __PYX_ERR(0, 160, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_28); __pyx_t_28 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

     172:     # This one gets raised for unknown port/service names.

    +173:     cares.ARES_ESERVICE:   cares.EAI_NONAME if MAC else cares.EAI_SERVICE,

      __pyx_t_2 = __Pyx_PyInt_From_int(ARES_ESERVICE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 173, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GetModuleGlobalName(__pyx_t_27, __pyx_n_s_MAC); if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 173, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_27);
      __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_27); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 173, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;
      if (__pyx_t_3) {
        __pyx_t_27 = __Pyx_PyInt_From_int(EAI_NONAME); if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 173, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_27);
        __pyx_t_28 = __pyx_t_27;
        __pyx_t_27 = 0;
      } else {
        __pyx_t_27 = __Pyx_PyInt_From_int(EAI_SERVICE); if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 173, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_27);
        __pyx_t_28 = __pyx_t_27;
        __pyx_t_27 = 0;
      }
      if (PyDict_SetItem(__pyx_t_29, __pyx_t_2, __pyx_t_28) < 0) __PYX_ERR(0, 160, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_28); __pyx_t_28 = 0;
      __Pyx_XGOTREF(__pyx_v_6gevent_8resolver_5cares__ares_to_gai_system);
      __Pyx_DECREF_SET(__pyx_v_6gevent_8resolver_5cares__ares_to_gai_system, ((PyObject*)__pyx_t_29));
      __Pyx_GIVEREF(__pyx_t_29);
      __pyx_t_29 = 0;

     174: }

     175:

    +176: cdef _gevent_gai_strerror(code):

    static PyObject *__pyx_f_6gevent_8resolver_5cares__gevent_gai_strerror(PyObject *__pyx_v_code) {
      char const *__pyx_v_err_str;
      PyObject *__pyx_v_result = 0;
      int __pyx_v_system;
      PyObject *__pyx_r = NULL;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("_gevent_gai_strerror", 0);
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_8);
      __Pyx_XDECREF(__pyx_t_9);
      __Pyx_XDECREF(__pyx_t_11);
      __Pyx_AddTraceback("gevent.resolver.cares._gevent_gai_strerror", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = 0;
      __pyx_L0:;
      __Pyx_XDECREF(__pyx_v_result);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

     177:     cdef const char* err_str

    +178:     cdef object result = None

      __Pyx_INCREF(Py_None);
      __pyx_v_result = Py_None;

     179:     cdef int system

    +180:     try:

      {
        /*try:*/ {
    /* … */
        }
    /* … */
        __Pyx_XGIVEREF(__pyx_t_1);
        __Pyx_XGIVEREF(__pyx_t_2);
        __Pyx_XGIVEREF(__pyx_t_3);
        __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
        goto __pyx_L1_error;
        __pyx_L4_exception_handled:;
        __Pyx_XGIVEREF(__pyx_t_1);
        __Pyx_XGIVEREF(__pyx_t_2);
        __Pyx_XGIVEREF(__pyx_t_3);
        __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
        __pyx_L8_try_end:;
      }

    +181:         system = _ares_to_gai_system[code]

          if (unlikely(__pyx_v_6gevent_8resolver_5cares__ares_to_gai_system == Py_None)) {
            PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
            __PYX_ERR(0, 181, __pyx_L3_error)
          }
          __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_6gevent_8resolver_5cares__ares_to_gai_system, __pyx_v_code); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 181, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 181, __pyx_L3_error)
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __pyx_v_system = __pyx_t_5;

    +182:     except KeyError:

        __pyx_t_5 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
        if (__pyx_t_5) {
          __Pyx_AddTraceback("gevent.resolver.cares._gevent_gai_strerror", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 182, __pyx_L5_except_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_GOTREF(__pyx_t_7);

    +183:         err_str = cares.ares_strerror(code)

          __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_code); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 183, __pyx_L5_except_error)
          __pyx_v_err_str = ares_strerror(__pyx_t_5);

    +184:         result = '%s: %s' % (_ares_errors.get(code) or code, _as_str(err_str))

          if (unlikely(__pyx_v_6gevent_8resolver_5cares__ares_errors == Py_None)) {
            PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
            __PYX_ERR(0, 184, __pyx_L5_except_error)
          }
          __pyx_t_9 = __Pyx_PyDict_GetItemDefault(__pyx_v_6gevent_8resolver_5cares__ares_errors, __pyx_v_code, Py_None); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 184, __pyx_L5_except_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 184, __pyx_L5_except_error)
          if (!__pyx_t_10) {
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          } else {
            __Pyx_INCREF(__pyx_t_9);
            __pyx_t_8 = __pyx_t_9;
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
            goto __pyx_L11_bool_binop_done;
          }
          __Pyx_INCREF(__pyx_v_code);
          __pyx_t_8 = __pyx_v_code;
          __pyx_L11_bool_binop_done:;
          __pyx_t_9 = __pyx_f_6gevent_8resolver_5cares__as_str(__pyx_v_err_str); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 184, __pyx_L5_except_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 184, __pyx_L5_except_error)
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_GIVEREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_8);
          __Pyx_GIVEREF(__pyx_t_9);
          PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_9);
          __pyx_t_8 = 0;
          __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyString_Format(__pyx_kp_s_s_s, __pyx_t_11); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 184, __pyx_L5_except_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_9);
          __pyx_t_9 = 0;
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          goto __pyx_L4_exception_handled;
        }
        goto __pyx_L5_except_error;
        __pyx_L5_except_error:;

     185:     else:

    +186:         err_str = cares.gai_strerror(system)

        /*else:*/ {
          __pyx_v_err_str = gai_strerror(__pyx_v_system);

    +187:         result = _as_str(err_str)

          __pyx_t_4 = __pyx_f_6gevent_8resolver_5cares__as_str(__pyx_v_err_str); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 187, __pyx_L5_except_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_4);
          __pyx_t_4 = 0;
        }
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        goto __pyx_L8_try_end;
        __pyx_L3_error:;
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    +188:     return result

      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_result);
      __pyx_r = __pyx_v_result;
      goto __pyx_L0;

     189:

    +190: cdef object _gevent_gaierror_from_status(int ares_status):

    static PyObject *__pyx_f_6gevent_8resolver_5cares__gevent_gaierror_from_status(int __pyx_v_ares_status) {
      PyObject *__pyx_v_code = 0;
      PyObject *__pyx_v_message = 0;
      PyObject *__pyx_r = NULL;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("_gevent_gaierror_from_status", 0);
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_AddTraceback("gevent.resolver.cares._gevent_gaierror_from_status", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = 0;
      __pyx_L0:;
      __Pyx_XDECREF(__pyx_v_code);
      __Pyx_XDECREF(__pyx_v_message);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    +191:     cdef object code = _ares_to_gai_system.get(ares_status, ares_status)

      if (unlikely(__pyx_v_6gevent_8resolver_5cares__ares_to_gai_system == Py_None)) {
        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
        __PYX_ERR(0, 191, __pyx_L1_error)
      }
      __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_ares_status); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 191, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_ares_status); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 191, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PyDict_GetItemDefault(__pyx_v_6gevent_8resolver_5cares__ares_to_gai_system, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 191, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_code = __pyx_t_3;
      __pyx_t_3 = 0;

    +192:     cdef object message = _gevent_gai_strerror(ares_status)

      __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_ares_status); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 192, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = __pyx_f_6gevent_8resolver_5cares__gevent_gai_strerror(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 192, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_v_message = __pyx_t_2;
      __pyx_t_2 = 0;

    +193:     return gaierror(code, message)

      __Pyx_XDECREF(__pyx_r);
      __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_gaierror); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 193, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = NULL;
      __pyx_t_4 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_1)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_4 = 1;
        }
      }
      {
        PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_v_code, __pyx_v_message};
        __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4);
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 193, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      }
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;

     194:

     195: cdef dict _ares_to_host_system = {

    +196:     cares.ARES_ENONAME:    cares.HOST_NOT_FOUND,

      __pyx_t_29 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 196, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_29);
      __pyx_t_28 = __Pyx_PyInt_From_int(ARES_ENONAME); if (unlikely(!__pyx_t_28)) __PYX_ERR(0, 196, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_28);
      __pyx_t_2 = __Pyx_PyInt_From_int(HOST_NOT_FOUND); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 196, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_29, __pyx_t_28, __pyx_t_2) < 0) __PYX_ERR(0, 196, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_28); __pyx_t_28 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    +197:     cares.ARES_ENOTFOUND:  cares.HOST_NOT_FOUND,

      __pyx_t_2 = __Pyx_PyInt_From_int(ARES_ENOTFOUND); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 197, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_28 = __Pyx_PyInt_From_int(HOST_NOT_FOUND); if (unlikely(!__pyx_t_28)) __PYX_ERR(0, 197, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_28);
      if (PyDict_SetItem(__pyx_t_29, __pyx_t_2, __pyx_t_28) < 0) __PYX_ERR(0, 196, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_28); __pyx_t_28 = 0;

    +198:     cares.ARES_ENODATA:    cares.NO_DATA,

      __pyx_t_28 = __Pyx_PyInt_From_int(ARES_ENODATA); if (unlikely(!__pyx_t_28)) __PYX_ERR(0, 198, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_28);
      __pyx_t_2 = __Pyx_PyInt_From_int(NO_DATA); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 198, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_29, __pyx_t_28, __pyx_t_2) < 0) __PYX_ERR(0, 196, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_28); __pyx_t_28 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XGOTREF(__pyx_v_6gevent_8resolver_5cares__ares_to_host_system);
      __Pyx_DECREF_SET(__pyx_v_6gevent_8resolver_5cares__ares_to_host_system, ((PyObject*)__pyx_t_29));
      __Pyx_GIVEREF(__pyx_t_29);
      __pyx_t_29 = 0;

     199: }

     200:

    +201: cdef _gevent_herror_strerror(code):

    static PyObject *__pyx_f_6gevent_8resolver_5cares__gevent_herror_strerror(PyObject *__pyx_v_code) {
      char const *__pyx_v_err_str;
      PyObject *__pyx_v_result = 0;
      int __pyx_v_system;
      PyObject *__pyx_r = NULL;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("_gevent_herror_strerror", 0);
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_8);
      __Pyx_XDECREF(__pyx_t_9);
      __Pyx_XDECREF(__pyx_t_11);
      __Pyx_AddTraceback("gevent.resolver.cares._gevent_herror_strerror", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = 0;
      __pyx_L0:;
      __Pyx_XDECREF(__pyx_v_result);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

     202:     cdef const char* err_str

    +203:     cdef object result = None

      __Pyx_INCREF(Py_None);
      __pyx_v_result = Py_None;

     204:     cdef int system

    +205:     try:

      {
        /*try:*/ {
    /* … */
        }
    /* … */
        __Pyx_XGIVEREF(__pyx_t_1);
        __Pyx_XGIVEREF(__pyx_t_2);
        __Pyx_XGIVEREF(__pyx_t_3);
        __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
        goto __pyx_L1_error;
        __pyx_L4_exception_handled:;
        __Pyx_XGIVEREF(__pyx_t_1);
        __Pyx_XGIVEREF(__pyx_t_2);
        __Pyx_XGIVEREF(__pyx_t_3);
        __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
        __pyx_L8_try_end:;
      }

    +206:         system = _ares_to_host_system[code]

          if (unlikely(__pyx_v_6gevent_8resolver_5cares__ares_to_host_system == Py_None)) {
            PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
            __PYX_ERR(0, 206, __pyx_L3_error)
          }
          __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_6gevent_8resolver_5cares__ares_to_host_system, __pyx_v_code); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 206, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 206, __pyx_L3_error)
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __pyx_v_system = __pyx_t_5;

    +207:     except KeyError:

        __pyx_t_5 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
        if (__pyx_t_5) {
          __Pyx_AddTraceback("gevent.resolver.cares._gevent_herror_strerror", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 207, __pyx_L5_except_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_GOTREF(__pyx_t_7);

    +208:         err_str = cares.ares_strerror(code)

          __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_code); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 208, __pyx_L5_except_error)
          __pyx_v_err_str = ares_strerror(__pyx_t_5);

    +209:         result = '%s: %s' % (_ares_errors.get(code) or code, _as_str(err_str))

          if (unlikely(__pyx_v_6gevent_8resolver_5cares__ares_errors == Py_None)) {
            PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
            __PYX_ERR(0, 209, __pyx_L5_except_error)
          }
          __pyx_t_9 = __Pyx_PyDict_GetItemDefault(__pyx_v_6gevent_8resolver_5cares__ares_errors, __pyx_v_code, Py_None); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 209, __pyx_L5_except_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 209, __pyx_L5_except_error)
          if (!__pyx_t_10) {
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          } else {
            __Pyx_INCREF(__pyx_t_9);
            __pyx_t_8 = __pyx_t_9;
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
            goto __pyx_L11_bool_binop_done;
          }
          __Pyx_INCREF(__pyx_v_code);
          __pyx_t_8 = __pyx_v_code;
          __pyx_L11_bool_binop_done:;
          __pyx_t_9 = __pyx_f_6gevent_8resolver_5cares__as_str(__pyx_v_err_str); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 209, __pyx_L5_except_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 209, __pyx_L5_except_error)
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_GIVEREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_8);
          __Pyx_GIVEREF(__pyx_t_9);
          PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_9);
          __pyx_t_8 = 0;
          __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyString_Format(__pyx_kp_s_s_s, __pyx_t_11); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 209, __pyx_L5_except_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_9);
          __pyx_t_9 = 0;
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          goto __pyx_L4_exception_handled;
        }
        goto __pyx_L5_except_error;
        __pyx_L5_except_error:;

     210:     else:

    +211:         err_str = cares.hstrerror(system)

        /*else:*/ {
          __pyx_v_err_str = hstrerror(__pyx_v_system);

    +212:         result = _as_str(err_str)

          __pyx_t_4 = __pyx_f_6gevent_8resolver_5cares__as_str(__pyx_v_err_str); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 212, __pyx_L5_except_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_4);
          __pyx_t_4 = 0;
        }
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        goto __pyx_L8_try_end;
        __pyx_L3_error:;
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    +213:     return result

      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_result);
      __pyx_r = __pyx_v_result;
      goto __pyx_L0;

     214:

     215:

    +216: cdef object _gevent_herror_from_status(int ares_status):

    static PyObject *__pyx_f_6gevent_8resolver_5cares__gevent_herror_from_status(int __pyx_v_ares_status) {
      PyObject *__pyx_v_code = 0;
      PyObject *__pyx_v_message = 0;
      PyObject *__pyx_r = NULL;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("_gevent_herror_from_status", 0);
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_AddTraceback("gevent.resolver.cares._gevent_herror_from_status", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = 0;
      __pyx_L0:;
      __Pyx_XDECREF(__pyx_v_code);
      __Pyx_XDECREF(__pyx_v_message);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    +217:     cdef object code = _ares_to_host_system.get(ares_status, ares_status)

      if (unlikely(__pyx_v_6gevent_8resolver_5cares__ares_to_host_system == Py_None)) {
        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
        __PYX_ERR(0, 217, __pyx_L1_error)
      }
      __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_ares_status); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 217, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_ares_status); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 217, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PyDict_GetItemDefault(__pyx_v_6gevent_8resolver_5cares__ares_to_host_system, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 217, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_code = __pyx_t_3;
      __pyx_t_3 = 0;

    +218:     cdef object message = _gevent_herror_strerror(ares_status)

      __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_ares_status); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 218, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = __pyx_f_6gevent_8resolver_5cares__gevent_herror_strerror(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 218, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_v_message = __pyx_t_2;
      __pyx_t_2 = 0;

    +219:     return herror(code, message)

      __Pyx_XDECREF(__pyx_r);
      __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_herror); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 219, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = NULL;
      __pyx_t_4 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_1)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_4 = 1;
        }
      }
      {
        PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_v_code, __pyx_v_message};
        __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4);
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 219, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      }
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;

     220:

     221:

    +222: class InvalidIP(ValueError):

      __pyx_tuple__6 = PyTuple_Pack(1, __pyx_builtin_ValueError); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 222, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__6);
      __Pyx_GIVEREF(__pyx_tuple__6);
    /* … */
      __pyx_t_29 = __Pyx_PEP560_update_bases(__pyx_tuple__7); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 222, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_29);
      __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_29); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 222, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_28 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_29, __pyx_n_s_InvalidIP, __pyx_n_s_InvalidIP, (PyObject *) NULL, __pyx_n_s_gevent_resolver_cares, (PyObject *) NULL); if (unlikely(!__pyx_t_28)) __PYX_ERR(0, 222, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_28);
      if (__pyx_t_29 != __pyx_tuple__7) {
        if (unlikely((PyDict_SetItemString(__pyx_t_28, "__orig_bases__", __pyx_tuple__7) < 0))) __PYX_ERR(0, 222, __pyx_L1_error)
      }
      __pyx_t_27 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_InvalidIP, __pyx_t_29, __pyx_t_28, NULL, 0, 0); if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 222, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_27);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_InvalidIP, __pyx_t_27) < 0) __PYX_ERR(0, 222, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;
      __Pyx_DECREF(__pyx_t_28); __pyx_t_28 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
      __pyx_tuple__7 = PyTuple_Pack(1, __pyx_builtin_ValueError); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 222, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__7);
      __Pyx_GIVEREF(__pyx_tuple__7);

     223:     pass

     224:

     225:

    +226: cdef void gevent_sock_state_callback(void *data, int s, int read, int write):

    static void __pyx_f_6gevent_8resolver_5cares_gevent_sock_state_callback(void *__pyx_v_data, int __pyx_v_s, int __pyx_v_read, int __pyx_v_write) {
      struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_ch = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("gevent_sock_state_callback", 0);
    /* … */
      /* function exit code */
      goto __pyx_L0;
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_WriteUnraisable("gevent.resolver.cares.gevent_sock_state_callback", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
      __pyx_L0:;
      __Pyx_XDECREF((PyObject *)__pyx_v_ch);
      __Pyx_RefNannyFinishContext();
    }

    +227:     if not data:

      __pyx_t_1 = ((!(__pyx_v_data != 0)) != 0);
      if (__pyx_t_1) {
    /* … */
      }

    +228:         return

        goto __pyx_L0;

    +229:     cdef channel ch = <channel>data

      __pyx_t_2 = ((PyObject *)__pyx_v_data);
      __Pyx_INCREF(__pyx_t_2);
      __pyx_v_ch = ((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_t_2);
      __pyx_t_2 = 0;

    +230:     ch._sock_state_callback(s, read, write)

      __pyx_t_2 = ((struct __pyx_vtabstruct_6gevent_8resolver_5cares_channel *)__pyx_v_ch->__pyx_vtab)->_sock_state_callback(__pyx_v_ch, __pyx_v_s, __pyx_v_read, __pyx_v_write); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 230, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

     231:

     232:

    +233: cdef class Result(object):

    struct __pyx_obj_6gevent_8resolver_5cares_Result {
      PyObject_HEAD
      PyObject *value;
      PyObject *exception;
    };

    +234:     cdef public object value

    /* Python wrapper */
    static PyObject *__pyx_pw_6gevent_8resolver_5cares_6Result_5value_1__get__(PyObject *__pyx_v_self); /*proto*/
    static PyObject *__pyx_pw_6gevent_8resolver_5cares_6Result_5value_1__get__(PyObject *__pyx_v_self) {
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
      __pyx_r = __pyx_pf_6gevent_8resolver_5cares_6Result_5value___get__(((struct __pyx_obj_6gevent_8resolver_5cares_Result *)__pyx_v_self));

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_6gevent_8resolver_5cares_6Result_5value___get__(struct __pyx_obj_6gevent_8resolver_5cares_Result *__pyx_v_self) {
      PyObject *__pyx_r = NULL;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__get__", 0);
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_self->value);
      __pyx_r = __pyx_v_self->value;
      goto __pyx_L0;

      /* function exit code */
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static int __pyx_pw_6gevent_8resolver_5cares_6Result_5value_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
    static int __pyx_pw_6gevent_8resolver_5cares_6Result_5value_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
      int __pyx_r;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
      __pyx_r = __pyx_pf_6gevent_8resolver_5cares_6Result_5value_2__set__(((struct __pyx_obj_6gevent_8resolver_5cares_Result *)__pyx_v_self), ((PyObject *)__pyx_v_value));

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static int __pyx_pf_6gevent_8resolver_5cares_6Result_5value_2__set__(struct __pyx_obj_6gevent_8resolver_5cares_Result *__pyx_v_self, PyObject *__pyx_v_value) {
      int __pyx_r;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__set__", 0);
      __Pyx_INCREF(__pyx_v_value);
      __Pyx_GIVEREF(__pyx_v_value);
      __Pyx_GOTREF(__pyx_v_self->value);
      __Pyx_DECREF(__pyx_v_self->value);
      __pyx_v_self->value = __pyx_v_value;

      /* function exit code */
      __pyx_r = 0;
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static int __pyx_pw_6gevent_8resolver_5cares_6Result_5value_5__del__(PyObject *__pyx_v_self); /*proto*/
    static int __pyx_pw_6gevent_8resolver_5cares_6Result_5value_5__del__(PyObject *__pyx_v_self) {
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
      int __pyx_r;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
      __pyx_r = __pyx_pf_6gevent_8resolver_5cares_6Result_5value_4__del__(((struct __pyx_obj_6gevent_8resolver_5cares_Result *)__pyx_v_self));

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static int __pyx_pf_6gevent_8resolver_5cares_6Result_5value_4__del__(struct __pyx_obj_6gevent_8resolver_5cares_Result *__pyx_v_self) {
      int __pyx_r;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__del__", 0);
      __Pyx_INCREF(Py_None);
      __Pyx_GIVEREF(Py_None);
      __Pyx_GOTREF(__pyx_v_self->value);
      __Pyx_DECREF(__pyx_v_self->value);
      __pyx_v_self->value = Py_None;

      /* function exit code */
      __pyx_r = 0;
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    +235:     cdef public object exception

    /* Python wrapper */
    static PyObject *__pyx_pw_6gevent_8resolver_5cares_6Result_9exception_1__get__(PyObject *__pyx_v_self); /*proto*/
    static PyObject *__pyx_pw_6gevent_8resolver_5cares_6Result_9exception_1__get__(PyObject *__pyx_v_self) {
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
      __pyx_r = __pyx_pf_6gevent_8resolver_5cares_6Result_9exception___get__(((struct __pyx_obj_6gevent_8resolver_5cares_Result *)__pyx_v_self));

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_6gevent_8resolver_5cares_6Result_9exception___get__(struct __pyx_obj_6gevent_8resolver_5cares_Result *__pyx_v_self) {
      PyObject *__pyx_r = NULL;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__get__", 0);
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_self->exception);
      __pyx_r = __pyx_v_self->exception;
      goto __pyx_L0;

      /* function exit code */
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static int __pyx_pw_6gevent_8resolver_5cares_6Result_9exception_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
    static int __pyx_pw_6gevent_8resolver_5cares_6Result_9exception_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
      int __pyx_r;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
      __pyx_r = __pyx_pf_6gevent_8resolver_5cares_6Result_9exception_2__set__(((struct __pyx_obj_6gevent_8resolver_5cares_Result *)__pyx_v_self), ((PyObject *)__pyx_v_value));

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static int __pyx_pf_6gevent_8resolver_5cares_6Result_9exception_2__set__(struct __pyx_obj_6gevent_8resolver_5cares_Result *__pyx_v_self, PyObject *__pyx_v_value) {
      int __pyx_r;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__set__", 0);
      __Pyx_INCREF(__pyx_v_value);
      __Pyx_GIVEREF(__pyx_v_value);
      __Pyx_GOTREF(__pyx_v_self->exception);
      __Pyx_DECREF(__pyx_v_self->exception);
      __pyx_v_self->exception = __pyx_v_value;

      /* function exit code */
      __pyx_r = 0;
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static int __pyx_pw_6gevent_8resolver_5cares_6Result_9exception_5__del__(PyObject *__pyx_v_self); /*proto*/
    static int __pyx_pw_6gevent_8resolver_5cares_6Result_9exception_5__del__(PyObject *__pyx_v_self) {
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
      int __pyx_r;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
      __pyx_r = __pyx_pf_6gevent_8resolver_5cares_6Result_9exception_4__del__(((struct __pyx_obj_6gevent_8resolver_5cares_Result *)__pyx_v_self));

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static int __pyx_pf_6gevent_8resolver_5cares_6Result_9exception_4__del__(struct __pyx_obj_6gevent_8resolver_5cares_Result *__pyx_v_self) {
      int __pyx_r;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__del__", 0);
      __Pyx_INCREF(Py_None);
      __Pyx_GIVEREF(Py_None);
      __Pyx_GOTREF(__pyx_v_self->exception);
      __Pyx_DECREF(__pyx_v_self->exception);
      __pyx_v_self->exception = Py_None;

      /* function exit code */
      __pyx_r = 0;
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

     236:

    +237:     def __init__(self, object value=None, object exception=None):

    /* Python wrapper */
    static int __pyx_pw_6gevent_8resolver_5cares_6Result_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static int __pyx_pw_6gevent_8resolver_5cares_6Result_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
      PyObject *__pyx_v_value = 0;
      PyObject *__pyx_v_exception = 0;
      CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
      int __pyx_r;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
      {
        #if CYTHON_USE_MODULE_STATE
        PyObject **__pyx_pyargnames[] = {&__pyx_n_s_value,&__pyx_n_s_exception,0};
        #else
        static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_value,&__pyx_n_s_exception,0};
        #endif
        PyObject* values[2] = {0,0};
        values[0] = ((PyObject *)Py_None);
        values[1] = ((PyObject *)Py_None);
        if (__pyx_kwds) {
          Py_ssize_t kw_args;
          switch (__pyx_nargs) {
            case  2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1);
            CYTHON_FALLTHROUGH;
            case  1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
            CYTHON_FALLTHROUGH;
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds);
          switch (__pyx_nargs) {
            case  0:
            if (kw_args > 0) {
              PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_value);
              if (value) { values[0] = value; kw_args--; }
              else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 237, __pyx_L3_error)
            }
            CYTHON_FALLTHROUGH;
            case  1:
            if (kw_args > 0) {
              PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_exception);
              if (value) { values[1] = value; kw_args--; }
              else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 237, __pyx_L3_error)
            }
          }
          if (unlikely(kw_args > 0)) {
            const Py_ssize_t kwd_pos_args = __pyx_nargs;
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 237, __pyx_L3_error)
          }
        } else {
          switch (__pyx_nargs) {
            case  2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1);
            CYTHON_FALLTHROUGH;
            case  1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
            CYTHON_FALLTHROUGH;
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
        }
        __pyx_v_value = values[0];
        __pyx_v_exception = values[1];
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 2, __pyx_nargs); __PYX_ERR(0, 237, __pyx_L3_error)
      __pyx_L3_error:;
      __Pyx_AddTraceback("gevent.resolver.cares.Result.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return -1;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_6gevent_8resolver_5cares_6Result___init__(((struct __pyx_obj_6gevent_8resolver_5cares_Result *)__pyx_v_self), __pyx_v_value, __pyx_v_exception);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static int __pyx_pf_6gevent_8resolver_5cares_6Result___init__(struct __pyx_obj_6gevent_8resolver_5cares_Result *__pyx_v_self, PyObject *__pyx_v_value, PyObject *__pyx_v_exception) {
      int __pyx_r;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__init__", 0);
    /* … */
      /* function exit code */
      __pyx_r = 0;
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    +238:         self.value = value

      __Pyx_INCREF(__pyx_v_value);
      __Pyx_GIVEREF(__pyx_v_value);
      __Pyx_GOTREF(__pyx_v_self->value);
      __Pyx_DECREF(__pyx_v_self->value);
      __pyx_v_self->value = __pyx_v_value;

    +239:         self.exception = exception

      __Pyx_INCREF(__pyx_v_exception);
      __Pyx_GIVEREF(__pyx_v_exception);
      __Pyx_GOTREF(__pyx_v_self->exception);
      __Pyx_DECREF(__pyx_v_self->exception);
      __pyx_v_self->exception = __pyx_v_exception;

     240:

    +241:     def __repr__(self):

    /* Python wrapper */
    static PyObject *__pyx_pw_6gevent_8resolver_5cares_6Result_3__repr__(PyObject *__pyx_v_self); /*proto*/
    static PyObject *__pyx_pw_6gevent_8resolver_5cares_6Result_3__repr__(PyObject *__pyx_v_self) {
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
      __pyx_r = __pyx_pf_6gevent_8resolver_5cares_6Result_2__repr__(((struct __pyx_obj_6gevent_8resolver_5cares_Result *)__pyx_v_self));

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_6gevent_8resolver_5cares_6Result_2__repr__(struct __pyx_obj_6gevent_8resolver_5cares_Result *__pyx_v_self) {
      PyObject *__pyx_r = NULL;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__repr__", 0);
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __Pyx_AddTraceback("gevent.resolver.cares.Result.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    +242:         if self.exception is None:

      __pyx_t_1 = (__pyx_v_self->exception == Py_None);
      __pyx_t_2 = (__pyx_t_1 != 0);
      if (__pyx_t_2) {
    /* … */
      }

    +243:             return '%s(%r)' % (self.__class__.__name__, self.value)

        __Pyx_XDECREF(__pyx_r);
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 243, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 243, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 243, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_4);
        PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
        __Pyx_INCREF(__pyx_v_self->value);
        __Pyx_GIVEREF(__pyx_v_self->value);
        PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self->value);
        __pyx_t_4 = 0;
        __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_s_r, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 243, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_r = __pyx_t_4;
        __pyx_t_4 = 0;
        goto __pyx_L0;

    +244:         elif self.value is None:

      __pyx_t_2 = (__pyx_v_self->value == Py_None);
      __pyx_t_1 = (__pyx_t_2 != 0);
      if (__pyx_t_1) {
    /* … */
      }

    +245:             return '%s(exception=%r)' % (self.__class__.__name__, self.exception)

        __Pyx_XDECREF(__pyx_r);
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 245, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 245, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 245, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_GIVEREF(__pyx_t_3);
        PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
        __Pyx_INCREF(__pyx_v_self->exception);
        __Pyx_GIVEREF(__pyx_v_self->exception);
        PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_self->exception);
        __pyx_t_3 = 0;
        __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_s_exception_r, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 245, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_r = __pyx_t_3;
        __pyx_t_3 = 0;
        goto __pyx_L0;

     246:         else:

    +247:             return '%s(value=%r, exception=%r)' % (self.__class__.__name__, self.value, self.exception)

      /*else*/ {
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 247, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 247, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 247, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_4);
        PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
        __Pyx_INCREF(__pyx_v_self->value);
        __Pyx_GIVEREF(__pyx_v_self->value);
        PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self->value);
        __Pyx_INCREF(__pyx_v_self->exception);
        __Pyx_GIVEREF(__pyx_v_self->exception);
        PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_self->exception);
        __pyx_t_4 = 0;
        __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_s_value_r_exception_r, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 247, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_r = __pyx_t_4;
        __pyx_t_4 = 0;
        goto __pyx_L0;
      }

     248:         # add repr_recursive precaution

     249:

    +250:     def successful(self):

    /* Python wrapper */
    static PyObject *__pyx_pw_6gevent_8resolver_5cares_6Result_5successful(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
    static PyMethodDef __pyx_mdef_6gevent_8resolver_5cares_6Result_5successful = {"successful", (PyCFunction)__pyx_pw_6gevent_8resolver_5cares_6Result_5successful, METH_NOARGS, 0};
    static PyObject *__pyx_pw_6gevent_8resolver_5cares_6Result_5successful(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("successful (wrapper)", 0);
      __pyx_r = __pyx_pf_6gevent_8resolver_5cares_6Result_4successful(((struct __pyx_obj_6gevent_8resolver_5cares_Result *)__pyx_v_self));

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_6gevent_8resolver_5cares_6Result_4successful(struct __pyx_obj_6gevent_8resolver_5cares_Result *__pyx_v_self) {
      PyObject *__pyx_r = NULL;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("successful", 0);
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_AddTraceback("gevent.resolver.cares.Result.successful", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }
    /* … */
      __pyx_tuple__8 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 250, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__8);
      __Pyx_GIVEREF(__pyx_tuple__8);
    /* … */
      __pyx_t_29 = __Pyx_CyFunction_New(&__pyx_mdef_6gevent_8resolver_5cares_6Result_5successful, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Result_successful, NULL, __pyx_n_s_gevent_resolver_cares, __pyx_d, ((PyObject *)__pyx_codeobj__9)); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 250, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_29);
      if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_8resolver_5cares_Result->tp_dict, __pyx_n_s_successful, __pyx_t_29) < 0) __PYX_ERR(0, 250, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
      PyType_Modified(__pyx_ptype_6gevent_8resolver_5cares_Result);
      __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__8, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_resolver_cares_pyx, __pyx_n_s_successful, 250, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 250, __pyx_L1_error)

    +251:         return self.exception is None

      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = (__pyx_v_self->exception == Py_None);
      __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 251, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;

     252:

    +253:     def get(self):

    /* Python wrapper */
    static PyObject *__pyx_pw_6gevent_8resolver_5cares_6Result_7get(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
    static PyMethodDef __pyx_mdef_6gevent_8resolver_5cares_6Result_7get = {"get", (PyCFunction)__pyx_pw_6gevent_8resolver_5cares_6Result_7get, METH_NOARGS, 0};
    static PyObject *__pyx_pw_6gevent_8resolver_5cares_6Result_7get(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("get (wrapper)", 0);
      __pyx_r = __pyx_pf_6gevent_8resolver_5cares_6Result_6get(((struct __pyx_obj_6gevent_8resolver_5cares_Result *)__pyx_v_self));

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_6gevent_8resolver_5cares_6Result_6get(struct __pyx_obj_6gevent_8resolver_5cares_Result *__pyx_v_self) {
      PyObject *__pyx_r = NULL;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("get", 0);
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_AddTraceback("gevent.resolver.cares.Result.get", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }
    /* … */
      __pyx_tuple__10 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 253, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__10);
      __Pyx_GIVEREF(__pyx_tuple__10);
    /* … */
      __pyx_t_29 = __Pyx_CyFunction_New(&__pyx_mdef_6gevent_8resolver_5cares_6Result_7get, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Result_get, NULL, __pyx_n_s_gevent_resolver_cares, __pyx_d, ((PyObject *)__pyx_codeobj__11)); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 253, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_29);
      if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_8resolver_5cares_Result->tp_dict, __pyx_n_s_get, __pyx_t_29) < 0) __PYX_ERR(0, 253, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
      PyType_Modified(__pyx_ptype_6gevent_8resolver_5cares_Result);
      __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_resolver_cares_pyx, __pyx_n_s_get, 253, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(0, 253, __pyx_L1_error)

    +254:         if self.exception is not None:

      __pyx_t_1 = (__pyx_v_self->exception != Py_None);
      __pyx_t_2 = (__pyx_t_1 != 0);
      if (unlikely(__pyx_t_2)) {
    /* … */
      }

    +255:             raise self.exception

        __Pyx_Raise(__pyx_v_self->exception, 0, 0, 0);
        __PYX_ERR(0, 255, __pyx_L1_error)

    +256:         return self.value

      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_self->value);
      __pyx_r = __pyx_v_self->value;
      goto __pyx_L0;

     257:

     258:

    +259: class ares_host_result(tuple):

      __pyx_t_29 = PyTuple_New(1); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 259, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_29);
      __Pyx_INCREF((PyObject *)(&PyTuple_Type));
      __Pyx_GIVEREF((PyObject *)(&PyTuple_Type));
      PyTuple_SET_ITEM(__pyx_t_29, 0, ((PyObject *)(&PyTuple_Type)));
      __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_29); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 259, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_28 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_28)) __PYX_ERR(0, 259, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_28);
      __pyx_t_27 = __Pyx_Py3MetaclassPrepare(__pyx_t_28, __pyx_t_2, __pyx_n_s_ares_host_result, __pyx_n_s_ares_host_result, (PyObject *) NULL, __pyx_n_s_gevent_resolver_cares, (PyObject *) NULL); if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 259, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_27);
      if (__pyx_t_2 != __pyx_t_29) {
        if (unlikely((PyDict_SetItemString(__pyx_t_27, "__orig_bases__", __pyx_t_29) < 0))) __PYX_ERR(0, 259, __pyx_L1_error)
      }
      __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
    /* … */
      __pyx_t_29 = __Pyx_Py3ClassCreate(__pyx_t_28, __pyx_n_s_ares_host_result, __pyx_t_2, __pyx_t_27, NULL, 0, 0); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 259, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_29);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_ares_host_result, __pyx_t_29) < 0) __PYX_ERR(0, 259, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
      __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;
      __Pyx_DECREF(__pyx_t_28); __pyx_t_28 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

     260:

    +261:     def __new__(cls, family, iterable):

    /* Python wrapper */
    static PyObject *__pyx_pw_6gevent_8resolver_5cares_16ares_host_result_1__new__(PyObject *__pyx_self,
    #if CYTHON_METH_FASTCALL
    PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
    #else
    PyObject *__pyx_args, PyObject *__pyx_kwds
    #endif
    ); /*proto*/
    static PyMethodDef __pyx_mdef_6gevent_8resolver_5cares_16ares_host_result_1__new__ = {"__new__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6gevent_8resolver_5cares_16ares_host_result_1__new__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
    static PyObject *__pyx_pw_6gevent_8resolver_5cares_16ares_host_result_1__new__(PyObject *__pyx_self,
    #if CYTHON_METH_FASTCALL
    PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
    #else
    PyObject *__pyx_args, PyObject *__pyx_kwds
    #endif
    ) {
      PyObject *__pyx_v_cls = 0;
      PyObject *__pyx_v_family = 0;
      PyObject *__pyx_v_iterable = 0;
      #if !CYTHON_METH_FASTCALL
      CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
      #endif
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__new__ (wrapper)", 0);
      {
        #if CYTHON_USE_MODULE_STATE
        PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cls,&__pyx_n_s_family,&__pyx_n_s_iterable,0};
        #else
        static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cls,&__pyx_n_s_family,&__pyx_n_s_iterable,0};
        #endif
        PyObject* values[3] = {0,0,0};
        if (__pyx_kwds) {
          Py_ssize_t kw_args;
          switch (__pyx_nargs) {
            case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
            CYTHON_FALLTHROUGH;
            case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
            CYTHON_FALLTHROUGH;
            case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
            CYTHON_FALLTHROUGH;
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
          switch (__pyx_nargs) {
            case  0:
            if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_cls)) != 0)) kw_args--;
            else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 261, __pyx_L3_error)
            else goto __pyx_L5_argtuple_error;
            CYTHON_FALLTHROUGH;
            case  1:
            if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_family)) != 0)) kw_args--;
            else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 261, __pyx_L3_error)
            else {
              __Pyx_RaiseArgtupleInvalid("__new__", 1, 3, 3, 1); __PYX_ERR(0, 261, __pyx_L3_error)
            }
            CYTHON_FALLTHROUGH;
            case  2:
            if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_iterable)) != 0)) kw_args--;
            else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 261, __pyx_L3_error)
            else {
              __Pyx_RaiseArgtupleInvalid("__new__", 1, 3, 3, 2); __PYX_ERR(0, 261, __pyx_L3_error)
            }
          }
          if (unlikely(kw_args > 0)) {
            const Py_ssize_t kwd_pos_args = __pyx_nargs;
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__new__") < 0)) __PYX_ERR(0, 261, __pyx_L3_error)
          }
        } else if (unlikely(__pyx_nargs != 3)) {
          goto __pyx_L5_argtuple_error;
        } else {
          values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
          values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
          values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        }
        __pyx_v_cls = values[0];
        __pyx_v_family = values[1];
        __pyx_v_iterable = values[2];
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("__new__", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 261, __pyx_L3_error)
      __pyx_L3_error:;
      __Pyx_AddTraceback("gevent.resolver.cares.ares_host_result.__new__", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_6gevent_8resolver_5cares_16ares_host_result___new__(__pyx_self, __pyx_v_cls, __pyx_v_family, __pyx_v_iterable);
      int __pyx_lineno = 0;
      const char *__pyx_filename = NULL;
      int __pyx_clineno = 0;

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_6gevent_8resolver_5cares_16ares_host_result___new__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cls, PyObject *__pyx_v_family, PyObject *__pyx_v_iterable) {
      PyObject *__pyx_v_self = 0;
      PyObject *__pyx_r = NULL;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__new__", 0);
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_AddTraceback("gevent.resolver.cares.ares_host_result.__new__", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XDECREF(__pyx_v_self);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }
    /* … */
      __pyx_tuple__12 = PyTuple_Pack(4, __pyx_n_s_cls, __pyx_n_s_family, __pyx_n_s_iterable, __pyx_n_s_self); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 261, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__12);
      __Pyx_GIVEREF(__pyx_tuple__12);
    /* … */
      __pyx_t_29 = __Pyx_CyFunction_New(&__pyx_mdef_6gevent_8resolver_5cares_16ares_host_result_1__new__, __Pyx_CYFUNCTION_STATICMETHOD, __pyx_n_s_ares_host_result___new, NULL, __pyx_n_s_gevent_resolver_cares, __pyx_d, ((PyObject *)__pyx_codeobj__13)); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 261, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_29);
      if (__Pyx_SetNewInClass(__pyx_t_27, __pyx_n_s_new, __pyx_t_29) < 0) __PYX_ERR(0, 261, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
      __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_resolver_cares_pyx, __pyx_n_s_new, 261, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 261, __pyx_L1_error)

    +262:         cdef object self = tuple.__new__(cls, iterable)

      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)(&PyTuple_Type)), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 262, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = NULL;
      __pyx_t_4 = 0;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_3)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
          __pyx_t_4 = 1;
        }
      }
      {
        PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_cls, __pyx_v_iterable};
        __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4);
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 262, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      }
      __pyx_v_self = __pyx_t_1;
      __pyx_t_1 = 0;

    +263:         self.family = family

      if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_family, __pyx_v_family) < 0) __PYX_ERR(0, 263, __pyx_L1_error)

    +264:         return self

      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_self);
      __pyx_r = __pyx_v_self;
      goto __pyx_L0;

     265:

    +266:     def __getnewargs__(self):

    /* Python wrapper */
    static PyObject *__pyx_pw_6gevent_8resolver_5cares_16ares_host_result_3__getnewargs__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
    static PyMethodDef __pyx_mdef_6gevent_8resolver_5cares_16ares_host_result_3__getnewargs__ = {"__getnewargs__", (PyCFunction)__pyx_pw_6gevent_8resolver_5cares_16ares_host_result_3__getnewargs__, METH_O, 0};
    static PyObject *__pyx_pw_6gevent_8resolver_5cares_16ares_host_result_3__getnewargs__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__getnewargs__ (wrapper)", 0);
      __pyx_r = __pyx_pf_6gevent_8resolver_5cares_16ares_host_result_2__getnewargs__(__pyx_self, ((PyObject *)__pyx_v_self));

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_6gevent_8resolver_5cares_16ares_host_result_2__getnewargs__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
      PyObject *__pyx_r = NULL;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__getnewargs__", 0);
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_AddTraceback("gevent.resolver.cares.ares_host_result.__getnewargs__", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }
    /* … */
      __pyx_tuple__14 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 266, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__14);
      __Pyx_GIVEREF(__pyx_tuple__14);
    /* … */
      __pyx_t_29 = __Pyx_CyFunction_New(&__pyx_mdef_6gevent_8resolver_5cares_16ares_host_result_3__getnewargs__, 0, __pyx_n_s_ares_host_result___getnewargs, NULL, __pyx_n_s_gevent_resolver_cares, __pyx_d, ((PyObject *)__pyx_codeobj__15)); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 266, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_29);
      if (__Pyx_SetNameInClass(__pyx_t_27, __pyx_n_s_getnewargs, __pyx_t_29) < 0) __PYX_ERR(0, 266, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
      __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_resolver_cares_pyx, __pyx_n_s_getnewargs, 266, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 266, __pyx_L1_error)

    +267:         return (self.family, tuple(self))

      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_family); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 267, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 267, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 267, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
      __pyx_t_1 = 0;
      __pyx_t_2 = 0;
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      goto __pyx_L0;

     268:

     269:

    +270: cdef list _parse_h_aliases(hostent* host):

    static PyObject *__pyx_f_6gevent_8resolver_5cares__parse_h_aliases(struct hostent *__pyx_v_host) {
      PyObject *__pyx_v_result = 0;
      char **__pyx_v_aliases;
      PyObject *__pyx_r = NULL;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("_parse_h_aliases", 0);
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_AddTraceback("gevent.resolver.cares._parse_h_aliases", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = 0;
      __pyx_L0:;
      __Pyx_XDECREF(__pyx_v_result);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    +271:     cdef list result = []

      __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 271, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_v_result = ((PyObject*)__pyx_t_1);
      __pyx_t_1 = 0;

    +272:     cdef char** aliases = host.h_aliases

      __pyx_t_2 = __pyx_v_host->h_aliases;
      __pyx_v_aliases = __pyx_t_2;

     273:

    +274:     if not aliases or not aliases[0]:

      __pyx_t_4 = ((!(__pyx_v_aliases != 0)) != 0);
      if (!__pyx_t_4) {
      } else {
        __pyx_t_3 = __pyx_t_4;
        goto __pyx_L4_bool_binop_done;
      }
      __pyx_t_4 = ((!((__pyx_v_aliases[0]) != 0)) != 0);
      __pyx_t_3 = __pyx_t_4;
      __pyx_L4_bool_binop_done:;
      if (__pyx_t_3) {
    /* … */
      }

    +275:         return result

        __Pyx_XDECREF(__pyx_r);
        __Pyx_INCREF(__pyx_v_result);
        __pyx_r = __pyx_v_result;
        goto __pyx_L0;

     276:

    +277:     while aliases[0]: # *aliases

      while (1) {
        __pyx_t_3 = ((__pyx_v_aliases[0]) != 0);
        if (!__pyx_t_3) break;

     278:         # The old C version of this excluded an alias if

     279:         # it matched the host name. I don't think the stdlib does that?

    +280:         result.append(_as_str(aliases[0]))

        __pyx_t_1 = __pyx_f_6gevent_8resolver_5cares__as_str((__pyx_v_aliases[0])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 280, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_1); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 280, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    +281:         aliases += 1

        __pyx_v_aliases = (__pyx_v_aliases + 1);
      }

    +282:     return result

      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_result);
      __pyx_r = __pyx_v_result;
      goto __pyx_L0;

     283:

     284:

    +285: cdef list _parse_h_addr_list(hostent* host):

    static PyObject *__pyx_f_6gevent_8resolver_5cares__parse_h_addr_list(struct hostent *__pyx_v_host) {
      PyObject *__pyx_v_result = 0;
      char **__pyx_v_addr_list;
      CYTHON_UNUSED int __pyx_v_addr_type;
      char __pyx_v_tmpbuf[46];
      PyObject *__pyx_r = NULL;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("_parse_h_addr_list", 0);
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_7);
      __Pyx_AddTraceback("gevent.resolver.cares._parse_h_addr_list", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = 0;
      __pyx_L0:;
      __Pyx_XDECREF(__pyx_v_result);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    +286:     cdef list result = []

      __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 286, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_v_result = ((PyObject*)__pyx_t_1);
      __pyx_t_1 = 0;

    +287:     cdef char** addr_list = host.h_addr_list

      __pyx_t_2 = __pyx_v_host->h_addr_list;
      __pyx_v_addr_list = __pyx_t_2;

    +288:     cdef int addr_type = host.h_addrtype

      __pyx_t_3 = __pyx_v_host->h_addrtype;
      __pyx_v_addr_type = __pyx_t_3;

     289:     # INET6_ADDRSTRLEN is 46, but we can't use that named constant

     290:     # here; cython doesn't like it.

     291:     cdef char tmpbuf[46]

     292:

    +293:     if not addr_list or not addr_list[0]:

      __pyx_t_5 = ((!(__pyx_v_addr_list != 0)) != 0);
      if (!__pyx_t_5) {
      } else {
        __pyx_t_4 = __pyx_t_5;
        goto __pyx_L4_bool_binop_done;
      }
      __pyx_t_5 = ((!((__pyx_v_addr_list[0]) != 0)) != 0);
      __pyx_t_4 = __pyx_t_5;
      __pyx_L4_bool_binop_done:;
      if (__pyx_t_4) {
    /* … */
      }

    +294:         return result

        __Pyx_XDECREF(__pyx_r);
        __Pyx_INCREF(__pyx_v_result);
        __pyx_r = __pyx_v_result;
        goto __pyx_L0;

     295:

    +296:     while addr_list[0]:

      while (1) {
        __pyx_t_4 = ((__pyx_v_addr_list[0]) != 0);
        if (!__pyx_t_4) break;

    +297:         if not cares.ares_inet_ntop(host.h_addrtype, addr_list[0], tmpbuf, INET6_ADDRSTRLEN):

        __pyx_t_4 = ((!(ares_inet_ntop(__pyx_v_host->h_addrtype, (__pyx_v_addr_list[0]), __pyx_v_tmpbuf, INET6_ADDRSTRLEN) != 0)) != 0);
        if (unlikely(__pyx_t_4)) {
    /* … */
        }

    +298:             raise _socket.error("Failed in ares_inet_ntop")

          __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_socket); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 298, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_error); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 298, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __pyx_t_6 = NULL;
          __pyx_t_3 = 0;
          if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
            __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
            if (likely(__pyx_t_6)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
              __Pyx_INCREF(__pyx_t_6);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_7, function);
              __pyx_t_3 = 1;
            }
          }
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_kp_s_Failed_in_ares_inet_ntop};
            __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_3, 1+__pyx_t_3);
            __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
            if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 298, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          }
          __Pyx_Raise(__pyx_t_1, 0, 0, 0);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __PYX_ERR(0, 298, __pyx_L1_error)

     299:

    +300:         result.append(_as_str(tmpbuf))

        __pyx_t_1 = __pyx_f_6gevent_8resolver_5cares__as_str(__pyx_v_tmpbuf); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 300, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 300, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    +301:         addr_list += 1

        __pyx_v_addr_list = (__pyx_v_addr_list + 1);
      }

     302:

    +303:     return result

      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_result);
      __pyx_r = __pyx_v_result;
      goto __pyx_L0;

     304:

     305:

    +306: cdef object _as_str(const char* val):

    static PyObject *__pyx_f_6gevent_8resolver_5cares__as_str(char const *__pyx_v_val) {
      PyObject *__pyx_r = NULL;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("_as_str", 0);
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_AddTraceback("gevent.resolver.cares._as_str", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = 0;
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    +307:     if not val:

      __pyx_t_1 = ((!(__pyx_v_val != 0)) != 0);
      if (__pyx_t_1) {
    /* … */
      }

    +308:         return None

        __Pyx_XDECREF(__pyx_r);
        __pyx_r = Py_None; __Pyx_INCREF(Py_None);
        goto __pyx_L0;

     309:

    +310:     if PY_MAJOR_VERSION < 3:

      __pyx_t_1 = ((PY_MAJOR_VERSION < 3) != 0);
      if (__pyx_t_1) {
    /* … */
      }

    +311:         return <bytes>val

        __Pyx_XDECREF(__pyx_r);
        __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_val); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 311, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_INCREF(((PyObject*)__pyx_t_2));
        __pyx_r = __pyx_t_2;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        goto __pyx_L0;

    +312:     return val.decode('utf-8')

      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_val, 0, strlen(__pyx_v_val), NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 312, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;

     313:

     314:

    +315: cdef void gevent_ares_nameinfo_callback(void *arg, int status, int timeouts, char *c_node, char *c_service):

    static void __pyx_f_6gevent_8resolver_5cares_gevent_ares_nameinfo_callback(void *__pyx_v_arg, int __pyx_v_status, CYTHON_UNUSED int __pyx_v_timeouts, char *__pyx_v_c_node, char *__pyx_v_c_service) {
      struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_channel = 0;
      PyObject *__pyx_v_callback = 0;
      PyObject *__pyx_v_node = 0;
      PyObject *__pyx_v_service = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("gevent_ares_nameinfo_callback", 0);
    /* … */
      /* function exit code */
      goto __pyx_L0;
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_8);
      __Pyx_XDECREF(__pyx_t_10);
      __Pyx_XDECREF(__pyx_t_11);
      __Pyx_XDECREF(__pyx_t_12);
      __Pyx_XDECREF(__pyx_t_13);
      __Pyx_WriteUnraisable("gevent.resolver.cares.gevent_ares_nameinfo_callback", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
      __pyx_L0:;
      __Pyx_XDECREF((PyObject *)__pyx_v_channel);
      __Pyx_XDECREF(__pyx_v_callback);
      __Pyx_XDECREF(__pyx_v_node);
      __Pyx_XDECREF(__pyx_v_service);
      __Pyx_RefNannyFinishContext();
    }

     316:     cdef channel channel

     317:     cdef object callback

    +318:     channel, callback = <tuple>arg

      __pyx_t_1 = ((PyObject *)__pyx_v_arg);
      __Pyx_INCREF(__pyx_t_1);
      if (likely(__pyx_t_1 != Py_None)) {
        PyObject* sequence = __pyx_t_1;
        Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
        if (unlikely(size != 2)) {
          if (size > 2) __Pyx_RaiseTooManyValuesError(2);
          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
          __PYX_ERR(0, 318, __pyx_L1_error)
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
        __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        #else
        __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 318, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 318, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      } else {
        __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(0, 318, __pyx_L1_error)
      }
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_6gevent_8resolver_5cares_channel))))) __PYX_ERR(0, 318, __pyx_L1_error)
      __pyx_v_channel = ((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_v_callback = __pyx_t_3;
      __pyx_t_3 = 0;

    +319:     Py_DECREF(<tuple>arg)

      Py_DECREF(((PyObject *)__pyx_v_arg));

     320:     cdef object node

     321:     cdef object service

    +322:     try:

      {
        /*try:*/ {
    /* … */
        }
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        goto __pyx_L8_try_end;
        __pyx_L3_error:;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    /* … */
        __Pyx_XGIVEREF(__pyx_t_4);
        __Pyx_XGIVEREF(__pyx_t_5);
        __Pyx_XGIVEREF(__pyx_t_6);
        __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
        goto __pyx_L1_error;
        __pyx_L4_exception_handled:;
        __Pyx_XGIVEREF(__pyx_t_4);
        __Pyx_XGIVEREF(__pyx_t_5);
        __Pyx_XGIVEREF(__pyx_t_6);
        __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
        __pyx_L8_try_end:;
      }

    +323:         if status:

          __pyx_t_7 = (__pyx_v_status != 0);
          if (__pyx_t_7) {
    /* … */
            goto __pyx_L9;
          }

    +324:             callback(Result(None, _gevent_gaierror_from_status(status)))

            __pyx_t_3 = __pyx_f_6gevent_8resolver_5cares__gevent_gaierror_from_status(__pyx_v_status); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 324, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_3);
            __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 324, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_INCREF(Py_None);
            __Pyx_GIVEREF(Py_None);
            PyTuple_SET_ITEM(__pyx_t_2, 0, Py_None);
            __Pyx_GIVEREF(__pyx_t_3);
            PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
            __pyx_t_3 = 0;
            __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_8resolver_5cares_Result), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 324, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __Pyx_INCREF(__pyx_v_callback);
            __pyx_t_2 = __pyx_v_callback; __pyx_t_8 = NULL;
            __pyx_t_9 = 0;
            if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
              __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
              if (likely(__pyx_t_8)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
                __Pyx_INCREF(__pyx_t_8);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_2, function);
                __pyx_t_9 = 1;
              }
            }
            {
              PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_3};
              __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9);
              __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
              __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
              if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 324, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_1);
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            }
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

     325:         else:

    +326:             node = _as_str(c_node)

          /*else*/ {
            __pyx_t_1 = __pyx_f_6gevent_8resolver_5cares__as_str(__pyx_v_c_node); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 326, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_v_node = __pyx_t_1;
            __pyx_t_1 = 0;

    +327:             service = _as_str(c_service)

            __pyx_t_1 = __pyx_f_6gevent_8resolver_5cares__as_str(__pyx_v_c_service); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 327, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_v_service = __pyx_t_1;
            __pyx_t_1 = 0;

    +328:             callback(Result((node, service)))

            __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 328, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_INCREF(__pyx_v_node);
            __Pyx_GIVEREF(__pyx_v_node);
            PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_node);
            __Pyx_INCREF(__pyx_v_service);
            __Pyx_GIVEREF(__pyx_v_service);
            PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_service);
            __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_6gevent_8resolver_5cares_Result), __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 328, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __Pyx_INCREF(__pyx_v_callback);
            __pyx_t_2 = __pyx_v_callback; __pyx_t_8 = NULL;
            __pyx_t_9 = 0;
            if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
              __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
              if (likely(__pyx_t_8)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
                __Pyx_INCREF(__pyx_t_8);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_2, function);
                __pyx_t_9 = 1;
              }
            }
            {
              PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_3};
              __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9);
              __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
              __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
              if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 328, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_1);
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            }
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          }
          __pyx_L9:;

    +329:     except:

        /*except:*/ {
          __Pyx_AddTraceback("gevent.resolver.cares.gevent_ares_nameinfo_callback", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3) < 0) __PYX_ERR(0, 329, __pyx_L5_except_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_GOTREF(__pyx_t_3);

    +330:         channel.loop.handle_error(callback, *sys.exc_info())

          __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_channel->loop, __pyx_n_s_handle_error); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 330, __pyx_L5_except_error)
          __Pyx_GOTREF(__pyx_t_8);
          __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 330, __pyx_L5_except_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_INCREF(__pyx_v_callback);
          __Pyx_GIVEREF(__pyx_v_callback);
          PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_callback);
          __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_sys); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 330, __pyx_L5_except_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_exc_info); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 330, __pyx_L5_except_error)
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_12 = NULL;
          __pyx_t_9 = 0;
          if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_13))) {
            __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_13);
            if (likely(__pyx_t_12)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
              __Pyx_INCREF(__pyx_t_12);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_13, function);
              __pyx_t_9 = 1;
            }
          }
          {
            PyObject *__pyx_callargs[1] = {__pyx_t_12, };
            __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_13, __pyx_callargs+1-__pyx_t_9, 0+__pyx_t_9);
            __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
            if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 330, __pyx_L5_except_error)
            __Pyx_GOTREF(__pyx_t_11);
            __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          }
          __pyx_t_13 = __Pyx_PySequence_Tuple(__pyx_t_11); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 330, __pyx_L5_except_error)
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          __pyx_t_11 = PyNumber_Add(__pyx_t_10, __pyx_t_13); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 330, __pyx_L5_except_error)
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_11, NULL); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 330, __pyx_L5_except_error)
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          goto __pyx_L4_exception_handled;
        }
        __pyx_L5_except_error:;

     331:

     332:

     333:

    +334: cdef int _make_sockaddr(const char* hostp, int port, int flowinfo, int scope_id, sockaddr_in6* sa6):

    static int __pyx_f_6gevent_8resolver_5cares__make_sockaddr(char const *__pyx_v_hostp, int __pyx_v_port, int __pyx_v_flowinfo, int __pyx_v_scope_id, struct sockaddr_in6 *__pyx_v_sa6) {
      int __pyx_r;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("_make_sockaddr", 0);
    /* … */
      /* function exit code */
      __pyx_L0:;
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    +335:     if cares.ares_inet_pton(AF_INET, hostp, &(<sockaddr_in*>sa6).sin_addr.s_addr) > 0:

      __pyx_t_1 = ((ares_inet_pton(AF_INET, __pyx_v_hostp, (&((struct sockaddr_in *)__pyx_v_sa6)->sin_addr.s_addr)) > 0) != 0);
      if (__pyx_t_1) {
    /* … */
      }

    +336:         (<sockaddr_in*>sa6).sin_family = AF_INET

        ((struct sockaddr_in *)__pyx_v_sa6)->sin_family = AF_INET;

    +337:         (<sockaddr_in*>sa6).sin_port = htons(port)

        ((struct sockaddr_in *)__pyx_v_sa6)->sin_port = htons(__pyx_v_port);

    +338:         return sizeof(sockaddr_in)

        __pyx_r = (sizeof(struct sockaddr_in));
        goto __pyx_L0;

     339:

    +340:     if cares.ares_inet_pton(AF_INET6, hostp, &(sa6.sin6_addr).s6_addr) > 0:

      __pyx_t_1 = ((ares_inet_pton(AF_INET6, __pyx_v_hostp, (&__pyx_v_sa6->sin6_addr.s6_addr)) > 0) != 0);
      if (__pyx_t_1) {
    /* … */
      }

    +341:         sa6.sin6_family = AF_INET6

        __pyx_v_sa6->sin6_family = AF_INET6;

    +342:         sa6.sin6_port = htons(port)

        __pyx_v_sa6->sin6_port = htons(__pyx_v_port);

    +343:         sa6.sin6_flowinfo = flowinfo

        __pyx_v_sa6->sin6_flowinfo = __pyx_v_flowinfo;

    +344:         sa6.sin6_scope_id = scope_id

        __pyx_v_sa6->sin6_scope_id = __pyx_v_scope_id;

    +345:         return sizeof(sockaddr_in6);

        __pyx_r = (sizeof(struct sockaddr_in6));
        goto __pyx_L0;

     346:

    +347:     return -1;

      __pyx_r = -1;
      goto __pyx_L0;

     348:

     349:

    +350: cdef class channel:

    struct __pyx_obj_6gevent_8resolver_5cares_channel {
      PyObject_HEAD
      struct __pyx_vtabstruct_6gevent_8resolver_5cares_channel *__pyx_vtab;
      struct ares_channeldata *channel;
      PyObject *loop;
      PyObject *_watchers;
      PyObject *_timer;
    };

    struct __pyx_vtabstruct_6gevent_8resolver_5cares_channel {
      PyObject *(*set_servers)(struct __pyx_obj_6gevent_8resolver_5cares_channel *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_8resolver_5cares_7channel_set_servers *__pyx_optional_args);
      PyObject *(*_sock_state_callback)(struct __pyx_obj_6gevent_8resolver_5cares_channel *, int, int, int);
      void (*_gethostbyname_or_byaddr_cb)(void *, int, int, struct hostent *);
      PyObject *(*_getnameinfo)(struct __pyx_obj_6gevent_8resolver_5cares_channel *, PyObject *, PyObject *, int, int __pyx_skip_dispatch);
      int (*_convert_cares_ni_flags)(int);
      int (*_convert_cares_ai_flags)(int);
      void (*_getaddrinfo_cb)(void *, int, int, struct ares_addrinfo *);
    };
    static struct __pyx_vtabstruct_6gevent_8resolver_5cares_channel *__pyx_vtabptr_6gevent_8resolver_5cares_channel;

     351:     cdef ares_channeldata* channel

     352:

    +353:     cdef readonly object loop

    /* Python wrapper */
    static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_4loop_1__get__(PyObject *__pyx_v_self); /*proto*/
    static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_4loop_1__get__(PyObject *__pyx_v_self) {
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
      __pyx_r = __pyx_pf_6gevent_8resolver_5cares_7channel_4loop___get__(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self));

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_6gevent_8resolver_5cares_7channel_4loop___get__(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self) {
      PyObject *__pyx_r = NULL;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__get__", 0);
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_self->loop);
      __pyx_r = __pyx_v_self->loop;
      goto __pyx_L0;

      /* function exit code */
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

     354:

     355:     cdef dict _watchers

     356:     cdef object _timer

     357:

    +358:     def __init__(self, object loop, flags=None, timeout=None, tries=None, ndots=None,

    /* Python wrapper */
    static int __pyx_pw_6gevent_8resolver_5cares_7channel_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static int __pyx_pw_6gevent_8resolver_5cares_7channel_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
      PyObject *__pyx_v_loop = 0;
      PyObject *__pyx_v_flags = 0;
      PyObject *__pyx_v_timeout = 0;
      PyObject *__pyx_v_tries = 0;
      PyObject *__pyx_v_ndots = 0;
      PyObject *__pyx_v_udp_port = 0;
      PyObject *__pyx_v_tcp_port = 0;
      PyObject *__pyx_v_servers = 0;
      CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
      int __pyx_r;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
      {
        #if CYTHON_USE_MODULE_STATE
        PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loop,&__pyx_n_s_flags,&__pyx_n_s_timeout,&__pyx_n_s_tries,&__pyx_n_s_ndots,&__pyx_n_s_udp_port,&__pyx_n_s_tcp_port,&__pyx_n_s_servers,0};
        #else
        static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loop,&__pyx_n_s_flags,&__pyx_n_s_timeout,&__pyx_n_s_tries,&__pyx_n_s_ndots,&__pyx_n_s_udp_port,&__pyx_n_s_tcp_port,&__pyx_n_s_servers,0};
        #endif
        PyObject* values[8] = {0,0,0,0,0,0,0,0};
        values[1] = ((PyObject *)Py_None);
        values[2] = ((PyObject *)Py_None);
        values[3] = ((PyObject *)Py_None);
        values[4] = ((PyObject *)Py_None);
    /* … */
      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static int __pyx_pf_6gevent_8resolver_5cares_7channel___init__(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self, PyObject *__pyx_v_loop, PyObject *__pyx_v_flags, PyObject *__pyx_v_timeout, PyObject *__pyx_v_tries, PyObject *__pyx_v_ndots, PyObject *__pyx_v_udp_port, PyObject *__pyx_v_tcp_port, PyObject *__pyx_v_servers) {
      struct ares_channeldata *__pyx_v_channel;
      struct ares_options __pyx_v_options;
      int __pyx_v_optmask;
      int __pyx_v_result;
      int __pyx_r;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__init__", 0);
    /* … */
      /* function exit code */
      __pyx_r = 0;
      goto __pyx_L0;
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_8);
      __Pyx_XDECREF(__pyx_t_9);
      __Pyx_XDECREF(__pyx_t_10);
      __Pyx_XDECREF(__pyx_t_15);
      __Pyx_AddTraceback("gevent.resolver.cares.channel.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = -1;
      __pyx_L0:;
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    +359:                  udp_port=None, tcp_port=None, servers=None):

        values[5] = ((PyObject *)Py_None);
        values[6] = ((PyObject *)Py_None);
        values[7] = ((PyObject *)Py_None);
        if (__pyx_kwds) {
          Py_ssize_t kw_args;
          switch (__pyx_nargs) {
            case  8: values[7] = __Pyx_Arg_VARARGS(__pyx_args, 7);
            CYTHON_FALLTHROUGH;
            case  7: values[6] = __Pyx_Arg_VARARGS(__pyx_args, 6);
            CYTHON_FALLTHROUGH;
            case  6: values[5] = __Pyx_Arg_VARARGS(__pyx_args, 5);
            CYTHON_FALLTHROUGH;
            case  5: values[4] = __Pyx_Arg_VARARGS(__pyx_args, 4);
            CYTHON_FALLTHROUGH;
            case  4: values[3] = __Pyx_Arg_VARARGS(__pyx_args, 3);
            CYTHON_FALLTHROUGH;
            case  3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2);
            CYTHON_FALLTHROUGH;
            case  2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1);
            CYTHON_FALLTHROUGH;
            case  1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
            CYTHON_FALLTHROUGH;
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds);
          switch (__pyx_nargs) {
            case  0:
            if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_loop)) != 0)) kw_args--;
            else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 358, __pyx_L3_error)
            else goto __pyx_L5_argtuple_error;
            CYTHON_FALLTHROUGH;
            case  1:
            if (kw_args > 0) {
              PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_flags);
              if (value) { values[1] = value; kw_args--; }
              else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 358, __pyx_L3_error)
            }
            CYTHON_FALLTHROUGH;
            case  2:
            if (kw_args > 0) {
              PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_timeout);
              if (value) { values[2] = value; kw_args--; }
              else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 358, __pyx_L3_error)
            }
            CYTHON_FALLTHROUGH;
            case  3:
            if (kw_args > 0) {
              PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_tries);
              if (value) { values[3] = value; kw_args--; }
              else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 358, __pyx_L3_error)
            }
            CYTHON_FALLTHROUGH;
            case  4:
            if (kw_args > 0) {
              PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ndots);
              if (value) { values[4] = value; kw_args--; }
              else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 358, __pyx_L3_error)
            }
            CYTHON_FALLTHROUGH;
            case  5:
            if (kw_args > 0) {
              PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_udp_port);
              if (value) { values[5] = value; kw_args--; }
              else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 358, __pyx_L3_error)
            }
            CYTHON_FALLTHROUGH;
            case  6:
            if (kw_args > 0) {
              PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_tcp_port);
              if (value) { values[6] = value; kw_args--; }
              else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 358, __pyx_L3_error)
            }
            CYTHON_FALLTHROUGH;
            case  7:
            if (kw_args > 0) {
              PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_servers);
              if (value) { values[7] = value; kw_args--; }
              else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 358, __pyx_L3_error)
            }
          }
          if (unlikely(kw_args > 0)) {
            const Py_ssize_t kwd_pos_args = __pyx_nargs;
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 358, __pyx_L3_error)
          }
        } else {
          switch (__pyx_nargs) {
            case  8: values[7] = __Pyx_Arg_VARARGS(__pyx_args, 7);
            CYTHON_FALLTHROUGH;
            case  7: values[6] = __Pyx_Arg_VARARGS(__pyx_args, 6);
            CYTHON_FALLTHROUGH;
            case  6: values[5] = __Pyx_Arg_VARARGS(__pyx_args, 5);
            CYTHON_FALLTHROUGH;
            case  5: values[4] = __Pyx_Arg_VARARGS(__pyx_args, 4);
            CYTHON_FALLTHROUGH;
            case  4: values[3] = __Pyx_Arg_VARARGS(__pyx_args, 3);
            CYTHON_FALLTHROUGH;
            case  3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2);
            CYTHON_FALLTHROUGH;
            case  2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1);
            CYTHON_FALLTHROUGH;
            case  1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
            break;
            default: goto __pyx_L5_argtuple_error;
          }
        }
        __pyx_v_loop = values[0];
        __pyx_v_flags = values[1];
        __pyx_v_timeout = values[2];
        __pyx_v_tries = values[3];
        __pyx_v_ndots = values[4];
        __pyx_v_udp_port = values[5];
        __pyx_v_tcp_port = values[6];
        __pyx_v_servers = values[7];
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 8, __pyx_nargs); __PYX_ERR(0, 358, __pyx_L3_error)
      __pyx_L3_error:;
      __Pyx_AddTraceback("gevent.resolver.cares.channel.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return -1;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_6gevent_8resolver_5cares_7channel___init__(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self), __pyx_v_loop, __pyx_v_flags, __pyx_v_timeout, __pyx_v_tries, __pyx_v_ndots, __pyx_v_udp_port, __pyx_v_tcp_port, __pyx_v_servers);

    +360:         cdef ares_channeldata* channel = NULL

      __pyx_v_channel = NULL;

     361:         cdef cares.ares_options options

    +362:         memset(&options, 0, sizeof(cares.ares_options))

      (void)(memset((&__pyx_v_options), 0, (sizeof(struct ares_options))));

    +363:         cdef int optmask = cares.ARES_OPT_SOCK_STATE_CB

      __pyx_v_optmask = ARES_OPT_SOCK_STATE_CB;

     364:

    +365:         options.sock_state_cb = <void*>gevent_sock_state_callback

      __pyx_v_options.sock_state_cb = ((void *)__pyx_f_6gevent_8resolver_5cares_gevent_sock_state_callback);

    +366:         options.sock_state_cb_data = <void*>self

      __pyx_v_options.sock_state_cb_data = ((void *)__pyx_v_self);

     367:

    +368:         if flags is not None:

      __pyx_t_1 = (__pyx_v_flags != Py_None);
      __pyx_t_2 = (__pyx_t_1 != 0);
      if (__pyx_t_2) {
    /* … */
      }

    +369:             options.flags = int(flags)

        __pyx_t_3 = __Pyx_PyNumber_Int(__pyx_v_flags); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 369, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 369, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_v_options.flags = __pyx_t_4;

    +370:             optmask |= cares.ARES_OPT_FLAGS

        __pyx_v_optmask = (__pyx_v_optmask | ARES_OPT_FLAGS);

     371:

    +372:         if timeout is not None:

      __pyx_t_2 = (__pyx_v_timeout != Py_None);
      __pyx_t_1 = (__pyx_t_2 != 0);
      if (__pyx_t_1) {
    /* … */
      }

    +373:             options.timeout = int(float(timeout) * 1000)

        __pyx_t_5 = __Pyx_PyObject_AsDouble(__pyx_v_timeout); if (unlikely(__pyx_t_5 == ((double)((double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 373, __pyx_L1_error)
        __pyx_v_options.timeout = ((int)(__pyx_t_5 * 1000.0));

    +374:             optmask |= cares.ARES_OPT_TIMEOUTMS

        __pyx_v_optmask = (__pyx_v_optmask | ARES_OPT_TIMEOUTMS);

     375:

    +376:         if tries is not None:

      __pyx_t_1 = (__pyx_v_tries != Py_None);
      __pyx_t_2 = (__pyx_t_1 != 0);
      if (__pyx_t_2) {
    /* … */
      }

    +377:             options.tries = int(tries)

        __pyx_t_3 = __Pyx_PyNumber_Int(__pyx_v_tries); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 377, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 377, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_v_options.tries = __pyx_t_4;

    +378:             optmask |= cares.ARES_OPT_TRIES

        __pyx_v_optmask = (__pyx_v_optmask | ARES_OPT_TRIES);

     379:

    +380:         if ndots is not None:

      __pyx_t_2 = (__pyx_v_ndots != Py_None);
      __pyx_t_1 = (__pyx_t_2 != 0);
      if (__pyx_t_1) {
    /* … */
      }

    +381:             options.ndots = int(ndots)

        __pyx_t_3 = __Pyx_PyNumber_Int(__pyx_v_ndots); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 381, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 381, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_v_options.ndots = __pyx_t_4;

    +382:             optmask |= cares.ARES_OPT_NDOTS

        __pyx_v_optmask = (__pyx_v_optmask | ARES_OPT_NDOTS);

     383:

    +384:         if udp_port is not None:

      __pyx_t_1 = (__pyx_v_udp_port != Py_None);
      __pyx_t_2 = (__pyx_t_1 != 0);
      if (__pyx_t_2) {
    /* … */
      }

    +385:             options.udp_port = int(udp_port)

        __pyx_t_3 = __Pyx_PyNumber_Int(__pyx_v_udp_port); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 385, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_6 = __Pyx_PyInt_As_unsigned_short(__pyx_t_3); if (unlikely((__pyx_t_6 == (unsigned short)-1) && PyErr_Occurred())) __PYX_ERR(0, 385, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_v_options.udp_port = __pyx_t_6;

    +386:             optmask |= cares.ARES_OPT_UDP_PORT

        __pyx_v_optmask = (__pyx_v_optmask | ARES_OPT_UDP_PORT);

     387:

    +388:         if tcp_port is not None:

      __pyx_t_2 = (__pyx_v_tcp_port != Py_None);
      __pyx_t_1 = (__pyx_t_2 != 0);
      if (__pyx_t_1) {
    /* … */
      }

    +389:             options.tcp_port = int(tcp_port)

        __pyx_t_3 = __Pyx_PyNumber_Int(__pyx_v_tcp_port); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 389, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_6 = __Pyx_PyInt_As_unsigned_short(__pyx_t_3); if (unlikely((__pyx_t_6 == (unsigned short)-1) && PyErr_Occurred())) __PYX_ERR(0, 389, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_v_options.tcp_port = __pyx_t_6;

    +390:             optmask |= cares.ARES_OPT_TCP_PORT

        __pyx_v_optmask = (__pyx_v_optmask | ARES_OPT_TCP_PORT);

     391:

    +392:         cdef int result = cares.ares_library_init(cares.ARES_LIB_INIT_ALL)  # ARES_LIB_INIT_WIN32 -DUSE_WINSOCK?

      __pyx_v_result = ares_library_init(ARES_LIB_INIT_ALL);

    +393:         if result:

      __pyx_t_1 = (__pyx_v_result != 0);
      if (unlikely(__pyx_t_1)) {
    /* … */
      }

    +394:             raise gaierror(result, _gevent_gai_strerror(result))

        __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_gaierror); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 394, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_result); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 394, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_result); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 394, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_10 = __pyx_f_6gevent_8resolver_5cares__gevent_gai_strerror(__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 394, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = NULL;
        __pyx_t_4 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
          __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_7);
          if (likely(__pyx_t_9)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
            __Pyx_INCREF(__pyx_t_9);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_7, function);
            __pyx_t_4 = 1;
          }
        }
        {
          PyObject *__pyx_callargs[3] = {__pyx_t_9, __pyx_t_8, __pyx_t_10};
          __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4);
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 394, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        }
        __Pyx_Raise(__pyx_t_3, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __PYX_ERR(0, 394, __pyx_L1_error)

    +395:         result = cares.ares_init_options(&channel, &options, optmask)

      __pyx_v_result = ares_init_options((&__pyx_v_channel), (&__pyx_v_options), __pyx_v_optmask);

    +396:         if result:

      __pyx_t_1 = (__pyx_v_result != 0);
      if (unlikely(__pyx_t_1)) {
    /* … */
      }

    +397:             raise gaierror(result, _gevent_gai_strerror(result))

        __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_gaierror); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 397, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_result); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 397, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_result); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 397, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_9 = __pyx_f_6gevent_8resolver_5cares__gevent_gai_strerror(__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 397, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_8 = NULL;
        __pyx_t_4 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
          __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
          if (likely(__pyx_t_8)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
            __Pyx_INCREF(__pyx_t_8);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_7, function);
            __pyx_t_4 = 1;
          }
        }
        {
          PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_t_10, __pyx_t_9};
          __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4);
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 397, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        }
        __Pyx_Raise(__pyx_t_3, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __PYX_ERR(0, 397, __pyx_L1_error)

    +398:         self._timer = loop.timer(TIMEOUT, TIMEOUT)

      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_loop, __pyx_n_s_timer); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 398, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 398, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GIVEREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_v_self->_timer);
      __Pyx_DECREF(__pyx_v_self->_timer);
      __pyx_v_self->_timer = __pyx_t_7;
      __pyx_t_7 = 0;
    /* … */
      __pyx_tuple_ = PyTuple_Pack(2, __pyx_int_1, __pyx_int_1); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 398, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple_);
      __Pyx_GIVEREF(__pyx_tuple_);

    +399:         self._watchers = {}

      __pyx_t_7 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 399, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_v_self->_watchers);
      __Pyx_DECREF(__pyx_v_self->_watchers);
      __pyx_v_self->_watchers = ((PyObject*)__pyx_t_7);
      __pyx_t_7 = 0;

    +400:         self.channel = channel

      __pyx_v_self->channel = __pyx_v_channel;

    +401:         try:

      {
        /*try:*/ {
    /* … */
        }
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
        goto __pyx_L16_try_end;
        __pyx_L11_error:;
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    /* … */
        __Pyx_XGIVEREF(__pyx_t_11);
        __Pyx_XGIVEREF(__pyx_t_12);
        __Pyx_XGIVEREF(__pyx_t_13);
        __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13);
        goto __pyx_L1_error;
        __pyx_L16_try_end:;
      }

    +402:             if servers is not None:

          __pyx_t_1 = (__pyx_v_servers != Py_None);
          __pyx_t_2 = (__pyx_t_1 != 0);
          if (__pyx_t_2) {
    /* … */
          }

    +403:                 self.set_servers(servers)

            __pyx_t_14.__pyx_n = 1;
            __pyx_t_14.servers = __pyx_v_servers;
            __pyx_t_7 = ((struct __pyx_vtabstruct_6gevent_8resolver_5cares_channel *)__pyx_v_self->__pyx_vtab)->set_servers(__pyx_v_self, 0, &__pyx_t_14); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 403, __pyx_L11_error)
            __Pyx_GOTREF(__pyx_t_7);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    +404:             self.loop = loop

          __Pyx_INCREF(__pyx_v_loop);
          __Pyx_GIVEREF(__pyx_v_loop);
          __Pyx_GOTREF(__pyx_v_self->loop);
          __Pyx_DECREF(__pyx_v_self->loop);
          __pyx_v_self->loop = __pyx_v_loop;

    +405:         except:

        /*except:*/ {
          __Pyx_AddTraceback("gevent.resolver.cares.channel.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_3, &__pyx_t_9) < 0) __PYX_ERR(0, 405, __pyx_L13_except_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_GOTREF(__pyx_t_9);

    +406:             self.destroy()

          __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_destroy); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 406, __pyx_L13_except_error)
          __Pyx_GOTREF(__pyx_t_8);
          __pyx_t_15 = NULL;
          __pyx_t_4 = 0;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
            __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_8);
            if (likely(__pyx_t_15)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
              __Pyx_INCREF(__pyx_t_15);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_8, function);
              __pyx_t_4 = 1;
            }
          }
          {
            PyObject *__pyx_callargs[1] = {__pyx_t_15, };
            __pyx_t_10 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
            __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
            if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 406, __pyx_L13_except_error)
            __Pyx_GOTREF(__pyx_t_10);
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          }
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

    +407:             raise

          __Pyx_GIVEREF(__pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_3);
          __Pyx_XGIVEREF(__pyx_t_9);
          __Pyx_ErrRestoreWithState(__pyx_t_7, __pyx_t_3, __pyx_t_9);
          __pyx_t_7 = 0; __pyx_t_3 = 0; __pyx_t_9 = 0;
          __PYX_ERR(0, 407, __pyx_L13_except_error)
        }
        __pyx_L13_except_error:;

     408:

    +409:     def __repr__(self):

    /* Python wrapper */
    static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_3__repr__(PyObject *__pyx_v_self); /*proto*/
    static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_3__repr__(PyObject *__pyx_v_self) {
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
      __pyx_r = __pyx_pf_6gevent_8resolver_5cares_7channel_2__repr__(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self));

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_6gevent_8resolver_5cares_7channel_2__repr__(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self) {
      PyObject *__pyx_v_args = NULL;
      PyObject *__pyx_r = NULL;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__repr__", 0);
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_5);
      __Pyx_AddTraceback("gevent.resolver.cares.channel.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XDECREF(__pyx_v_args);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    +410:         args = (self.__class__.__name__, id(self), self._timer, len(self._watchers))

      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 410, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 410, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 410, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = __pyx_v_self->_watchers;
      __Pyx_INCREF(__pyx_t_3);
      if (unlikely(__pyx_t_3 == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
        __PYX_ERR(0, 410, __pyx_L1_error)
      }
      __pyx_t_4 = PyDict_Size(__pyx_t_3); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 410, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 410, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 410, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
      __Pyx_INCREF(__pyx_v_self->_timer);
      __Pyx_GIVEREF(__pyx_v_self->_timer);
      PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_self->_timer);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_3);
      __pyx_t_2 = 0;
      __pyx_t_1 = 0;
      __pyx_t_3 = 0;
      __pyx_v_args = ((PyObject*)__pyx_t_5);
      __pyx_t_5 = 0;

    +411:         return '<%s at 0x%x _timer=%r _watchers[%s]>' % args

      __Pyx_XDECREF(__pyx_r);
      __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_s_at_0x_x__timer_r__watchers_s, __pyx_v_args); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 411, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_r = __pyx_t_5;
      __pyx_t_5 = 0;
      goto __pyx_L0;

     412:

    +413:     def destroy(self):

    /* Python wrapper */
    static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_5destroy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
    static PyMethodDef __pyx_mdef_6gevent_8resolver_5cares_7channel_5destroy = {"destroy", (PyCFunction)__pyx_pw_6gevent_8resolver_5cares_7channel_5destroy, METH_NOARGS, 0};
    static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_5destroy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("destroy (wrapper)", 0);
      __pyx_r = __pyx_pf_6gevent_8resolver_5cares_7channel_4destroy(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self));

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_6gevent_8resolver_5cares_7channel_4destroy(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self) {
      PyObject *__pyx_r = NULL;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("destroy", 0);
    /* … */
      /* function exit code */
      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      goto __pyx_L0;
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_5);
      __Pyx_AddTraceback("gevent.resolver.cares.channel.destroy", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }
    /* … */
      __pyx_tuple__16 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 413, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__16);
      __Pyx_GIVEREF(__pyx_tuple__16);
    /* … */
      __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6gevent_8resolver_5cares_7channel_5destroy, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_channel_destroy, NULL, __pyx_n_s_gevent_resolver_cares, __pyx_d, ((PyObject *)__pyx_codeobj__17)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 413, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_8resolver_5cares_channel->tp_dict, __pyx_n_s_destroy, __pyx_t_2) < 0) __PYX_ERR(0, 413, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      PyType_Modified(__pyx_ptype_6gevent_8resolver_5cares_channel);
      __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__16, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_resolver_cares_pyx, __pyx_n_s_destroy, 413, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) __PYX_ERR(0, 413, __pyx_L1_error)

    +414:         if self.channel:

      __pyx_t_1 = (__pyx_v_self->channel != 0);
      if (__pyx_t_1) {
    /* … */
      }

     415:             # XXX ares_library_cleanup?

    +416:             cares.ares_destroy(self.channel)

        ares_destroy(__pyx_v_self->channel);

    +417:             self.channel = NULL

        __pyx_v_self->channel = NULL;

    +418:             self._watchers.clear()

        if (unlikely(__pyx_v_self->_watchers == Py_None)) {
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "clear");
          __PYX_ERR(0, 418, __pyx_L1_error)
        }
        __pyx_t_2 = __Pyx_PyDict_Clear(__pyx_v_self->_watchers); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 418, __pyx_L1_error)

    +419:             self._timer.stop()

        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_timer, __pyx_n_s_stop); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 419, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_5 = NULL;
        __pyx_t_6 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
          if (likely(__pyx_t_5)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
            __Pyx_INCREF(__pyx_t_5);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_4, function);
            __pyx_t_6 = 1;
          }
        }
        {
          PyObject *__pyx_callargs[1] = {__pyx_t_5, };
          __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6);
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 419, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        }
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    +420:             self.loop = None

        __Pyx_INCREF(Py_None);
        __Pyx_GIVEREF(Py_None);
        __Pyx_GOTREF(__pyx_v_self->loop);
        __Pyx_DECREF(__pyx_v_self->loop);
        __pyx_v_self->loop = Py_None;

     421:

    +422:     def __dealloc__(self):

    /* Python wrapper */
    static void __pyx_pw_6gevent_8resolver_5cares_7channel_7__dealloc__(PyObject *__pyx_v_self); /*proto*/
    static void __pyx_pw_6gevent_8resolver_5cares_7channel_7__dealloc__(PyObject *__pyx_v_self) {
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
      __pyx_pf_6gevent_8resolver_5cares_7channel_6__dealloc__(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self));

      /* function exit code */
      __Pyx_RefNannyFinishContext();
    }

    static void __pyx_pf_6gevent_8resolver_5cares_7channel_6__dealloc__(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self) {
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__dealloc__", 0);
    /* … */
      /* function exit code */
      __Pyx_RefNannyFinishContext();
    }

    +423:         if self.channel:

      __pyx_t_1 = (__pyx_v_self->channel != 0);
      if (__pyx_t_1) {
    /* … */
      }

     424:             # XXX ares_library_cleanup?

    +425:             cares.ares_destroy(self.channel)

        ares_destroy(__pyx_v_self->channel);

    +426:             self.channel = NULL

        __pyx_v_self->channel = NULL;

     427:

    +428:     cpdef set_servers(self, servers=None):

    static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_9set_servers(PyObject *__pyx_v_self,
    #if CYTHON_METH_FASTCALL
    PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
    #else
    PyObject *__pyx_args, PyObject *__pyx_kwds
    #endif
    ); /*proto*/
    static PyObject *__pyx_f_6gevent_8resolver_5cares_7channel_set_servers(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_8resolver_5cares_7channel_set_servers *__pyx_optional_args) {
      PyObject *__pyx_v_servers = ((PyObject *)Py_None);
      int __pyx_v_length;
      CYTHON_UNUSED int __pyx_v_result;
      int __pyx_v_index;
      char *__pyx_v_string;
      struct ares_addr_node *__pyx_v_c_servers;
      PyObject *__pyx_v_server = NULL;
      PyObject *__pyx_r = NULL;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("set_servers", 0);
      if (__pyx_optional_args) {
        if (__pyx_optional_args->__pyx_n > 0) {
          __pyx_v_servers = __pyx_optional_args->servers;
        }
      }
      __Pyx_INCREF(__pyx_v_servers);
      /* Check if called by wrapper */
      if (unlikely(__pyx_skip_dispatch)) ;
      /* Check if overridden in Python */
      else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
        #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
        static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
        if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
          PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
          #endif
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_servers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 428, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          #ifdef __Pyx_CyFunction_USED
          if (!__Pyx_IsCyOrPyCFunction(__pyx_t_1)
          #else
          if (!PyCFunction_Check(__pyx_t_1)
          #endif
                  || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_8resolver_5cares_7channel_9set_servers)) {
            __Pyx_XDECREF(__pyx_r);
            __Pyx_INCREF(__pyx_t_1);
            __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
            __pyx_t_5 = 0;
            if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
              __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
              if (likely(__pyx_t_4)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
                __Pyx_INCREF(__pyx_t_4);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_3, function);
                __pyx_t_5 = 1;
              }
            }
            {
              PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_servers};
              __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
              __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
              if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 428, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_2);
              __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            }
            __pyx_r = __pyx_t_2;
            __pyx_t_2 = 0;
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            goto __pyx_L0;
          }
          #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
          __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
          __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
          if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
            __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
          }
          #endif
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
        }
        #endif
      }
    /* … */
      /* function exit code */
      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      goto __pyx_L0;
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_11);
      __Pyx_AddTraceback("gevent.resolver.cares.channel.set_servers", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = 0;
      __pyx_L0:;
      __Pyx_XDECREF(__pyx_v_server);
      __Pyx_XDECREF(__pyx_v_servers);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_9set_servers(PyObject *__pyx_v_self,
    #if CYTHON_METH_FASTCALL
    PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
    #else
    PyObject *__pyx_args, PyObject *__pyx_kwds
    #endif
    ); /*proto*/
    static PyMethodDef __pyx_mdef_6gevent_8resolver_5cares_7channel_9set_servers = {"set_servers", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6gevent_8resolver_5cares_7channel_9set_servers, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
    static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_9set_servers(PyObject *__pyx_v_self,
    #if CYTHON_METH_FASTCALL
    PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
    #else
    PyObject *__pyx_args, PyObject *__pyx_kwds
    #endif
    ) {
      PyObject *__pyx_v_servers = 0;
      #if !CYTHON_METH_FASTCALL
      CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
      #endif
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("set_servers (wrapper)", 0);
      {
        #if CYTHON_USE_MODULE_STATE
        PyObject **__pyx_pyargnames[] = {&__pyx_n_s_servers,0};
        #else
        static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_servers,0};
        #endif
        PyObject* values[1] = {0};
        values[0] = ((PyObject *)Py_None);
        if (__pyx_kwds) {
          Py_ssize_t kw_args;
          switch (__pyx_nargs) {
            case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
            CYTHON_FALLTHROUGH;
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
          switch (__pyx_nargs) {
            case  0:
            if (kw_args > 0) {
              PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_servers);
              if (value) { values[0] = value; kw_args--; }
              else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 428, __pyx_L3_error)
            }
          }
          if (unlikely(kw_args > 0)) {
            const Py_ssize_t kwd_pos_args = __pyx_nargs;
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_servers") < 0)) __PYX_ERR(0, 428, __pyx_L3_error)
          }
        } else {
          switch (__pyx_nargs) {
            case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
            CYTHON_FALLTHROUGH;
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
        }
        __pyx_v_servers = values[0];
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("set_servers", 0, 0, 1, __pyx_nargs); __PYX_ERR(0, 428, __pyx_L3_error)
      __pyx_L3_error:;
      __Pyx_AddTraceback("gevent.resolver.cares.channel.set_servers", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_6gevent_8resolver_5cares_7channel_8set_servers(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self), __pyx_v_servers);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_6gevent_8resolver_5cares_7channel_8set_servers(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self, PyObject *__pyx_v_servers) {
      PyObject *__pyx_r = NULL;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("set_servers", 0);
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2.__pyx_n = 1;
      __pyx_t_2.servers = __pyx_v_servers;
      __pyx_t_1 = __pyx_vtabptr_6gevent_8resolver_5cares_channel->set_servers(__pyx_v_self, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 428, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;

      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_AddTraceback("gevent.resolver.cares.channel.set_servers", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }
    /* … */
      __pyx_tuple__18 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_servers); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 428, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__18);
      __Pyx_GIVEREF(__pyx_tuple__18);
      __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_resolver_cares_pyx, __pyx_n_s_set_servers, 428, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) __PYX_ERR(0, 428, __pyx_L1_error)
    /* … */
      __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6gevent_8resolver_5cares_7channel_9set_servers, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_channel_set_servers, NULL, __pyx_n_s_gevent_resolver_cares, __pyx_d, ((PyObject *)__pyx_codeobj__19)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 428, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__20);
      if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_8resolver_5cares_channel->tp_dict, __pyx_n_s_set_servers, __pyx_t_2) < 0) __PYX_ERR(0, 428, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      PyType_Modified(__pyx_ptype_6gevent_8resolver_5cares_channel);
      __pyx_tuple__20 = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 428, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__20);
      __Pyx_GIVEREF(__pyx_tuple__20);
    /* … */
    struct __pyx_opt_args_6gevent_8resolver_5cares_7channel_set_servers {
      int __pyx_n;
      PyObject *servers;
    };

    +429:         if not self.channel:

      __pyx_t_6 = ((!(__pyx_v_self->channel != 0)) != 0);
      if (unlikely(__pyx_t_6)) {
    /* … */
      }

    +430:             raise gaierror(cares.ARES_EDESTRUCTION, 'this ares channel has been destroyed')

        __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_gaierror); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 430, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_3 = __Pyx_PyInt_From_int(ARES_EDESTRUCTION); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 430, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_4 = NULL;
        __pyx_t_5 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_2, function);
            __pyx_t_5 = 1;
          }
        }
        {
          PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_t_3, __pyx_kp_s_this_ares_channel_has_been_destr};
          __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5);
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 430, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        }
        __Pyx_Raise(__pyx_t_1, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __PYX_ERR(0, 430, __pyx_L1_error)

    +431:         if not servers:

      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_servers); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 431, __pyx_L1_error)
      __pyx_t_7 = ((!__pyx_t_6) != 0);
      if (__pyx_t_7) {
    /* … */
      }

    +432:             servers = []

        __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 432, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF_SET(__pyx_v_servers, __pyx_t_1);
        __pyx_t_1 = 0;

    +433:         if isinstance(servers, string_types):

      __pyx_t_1 = __pyx_v_6gevent_8resolver_5cares_string_types;
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_7 = PyObject_IsInstance(__pyx_v_servers, __pyx_t_1); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 433, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_6 = (__pyx_t_7 != 0);
      if (__pyx_t_6) {
    /* … */
      }

    +434:             servers = servers.split(',')

        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_servers, __pyx_n_s_split); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 434, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_3 = NULL;
        __pyx_t_5 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
          if (likely(__pyx_t_3)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
            __Pyx_INCREF(__pyx_t_3);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_2, function);
            __pyx_t_5 = 1;
          }
        }
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_s__2};
          __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 434, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        }
        __Pyx_DECREF_SET(__pyx_v_servers, __pyx_t_1);
        __pyx_t_1 = 0;

    +435:         cdef int length = len(servers)

      __pyx_t_8 = PyObject_Length(__pyx_v_servers); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 435, __pyx_L1_error)
      __pyx_v_length = __pyx_t_8;

     436:         cdef int result, index

     437:         cdef char* string

     438:         cdef cares.ares_addr_node* c_servers

    +439:         if length <= 0:

      __pyx_t_6 = ((__pyx_v_length <= 0) != 0);
      if (__pyx_t_6) {
    /* … */
        goto __pyx_L6;
      }

    +440:             result = cares.ares_set_servers(self.channel, NULL)

        __pyx_v_result = ares_set_servers(__pyx_v_self->channel, NULL);

     441:         else:

    +442:             c_servers = <cares.ares_addr_node*>PyMem_Malloc(sizeof(cares.ares_addr_node) * length)

      /*else*/ {
        __pyx_v_c_servers = ((struct ares_addr_node *)PyMem_Malloc(((sizeof(struct ares_addr_node)) * __pyx_v_length)));

    +443:             if not c_servers:

        __pyx_t_6 = ((!(__pyx_v_c_servers != 0)) != 0);
        if (unlikely(__pyx_t_6)) {
    /* … */
        }

    +444:                 raise MemoryError

          PyErr_NoMemory(); __PYX_ERR(0, 444, __pyx_L1_error)

    +445:             try:

        /*try:*/ {

    +446:                 index = 0

          __pyx_v_index = 0;

    +447:                 for server in servers:

          if (likely(PyList_CheckExact(__pyx_v_servers)) || PyTuple_CheckExact(__pyx_v_servers)) {
            __pyx_t_1 = __pyx_v_servers; __Pyx_INCREF(__pyx_t_1); __pyx_t_8 = 0;
            __pyx_t_9 = NULL;
          } else {
            __pyx_t_8 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_servers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 447, __pyx_L9_error)
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 447, __pyx_L9_error)
          }
          for (;;) {
            if (likely(!__pyx_t_9)) {
              if (likely(PyList_CheckExact(__pyx_t_1))) {
                if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_1)) break;
                #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_2); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 447, __pyx_L9_error)
                #else
                __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 447, __pyx_L9_error)
                __Pyx_GOTREF(__pyx_t_2);
                #endif
              } else {
                if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
                #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_2); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 447, __pyx_L9_error)
                #else
                __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 447, __pyx_L9_error)
                __Pyx_GOTREF(__pyx_t_2);
                #endif
              }
            } else {
              __pyx_t_2 = __pyx_t_9(__pyx_t_1);
              if (unlikely(!__pyx_t_2)) {
                PyObject* exc_type = PyErr_Occurred();
                if (exc_type) {
                  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
                  else __PYX_ERR(0, 447, __pyx_L9_error)
                }
                break;
              }
              __Pyx_GOTREF(__pyx_t_2);
            }
            __Pyx_XDECREF_SET(__pyx_v_server, __pyx_t_2);
            __pyx_t_2 = 0;
    /* … */
          }
          __pyx_L12_break:;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    +448:                     if isinstance(server, unicode):

            __pyx_t_6 = PyUnicode_Check(__pyx_v_server);
            __pyx_t_7 = (__pyx_t_6 != 0);
            if (__pyx_t_7) {
    /* … */
            }

    +449:                         server = server.encode('ascii')

              __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_server, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 449, __pyx_L9_error)
              __Pyx_GOTREF(__pyx_t_3);
              __pyx_t_4 = NULL;
              __pyx_t_5 = 0;
              if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
                __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
                if (likely(__pyx_t_4)) {
                  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
                  __Pyx_INCREF(__pyx_t_4);
                  __Pyx_INCREF(function);
                  __Pyx_DECREF_SET(__pyx_t_3, function);
                  __pyx_t_5 = 1;
                }
              }
              {
                PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_n_s_ascii};
                __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
                __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
                if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 449, __pyx_L9_error)
                __Pyx_GOTREF(__pyx_t_2);
                __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
              }
              __Pyx_DECREF_SET(__pyx_v_server, __pyx_t_2);
              __pyx_t_2 = 0;

    +450:                     string = <char*?>server

            __pyx_t_10 = __Pyx_PyObject_AsWritableString(__pyx_v_server); if (unlikely((!__pyx_t_10) && PyErr_Occurred())) __PYX_ERR(0, 450, __pyx_L9_error)
            __pyx_v_string = ((char *)__pyx_t_10);

    +451:                     if cares.ares_inet_pton(AF_INET, string, &c_servers[index].addr) > 0:

            __pyx_t_7 = ((ares_inet_pton(AF_INET, __pyx_v_string, (&(__pyx_v_c_servers[__pyx_v_index]).addr)) > 0) != 0);
            if (__pyx_t_7) {
    /* … */
              goto __pyx_L14;
            }

    +452:                         c_servers[index].family = AF_INET

              (__pyx_v_c_servers[__pyx_v_index]).family = AF_INET;

    +453:                     elif cares.ares_inet_pton(AF_INET6, string, &c_servers[index].addr) > 0:

            __pyx_t_7 = ((ares_inet_pton(AF_INET6, __pyx_v_string, (&(__pyx_v_c_servers[__pyx_v_index]).addr)) > 0) != 0);
            if (likely(__pyx_t_7)) {
    /* … */
              goto __pyx_L14;
            }

    +454:                         c_servers[index].family = AF_INET6

              (__pyx_v_c_servers[__pyx_v_index]).family = AF_INET6;

     455:                     else:

    +456:                         raise InvalidIP(repr(string))

            /*else*/ {
              __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_InvalidIP); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 456, __pyx_L9_error)
              __Pyx_GOTREF(__pyx_t_3);
              __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_string); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 456, __pyx_L9_error)
              __Pyx_GOTREF(__pyx_t_4);
              __pyx_t_11 = PyObject_Repr(__pyx_t_4); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 456, __pyx_L9_error)
              __Pyx_GOTREF(__pyx_t_11);
              __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
              __pyx_t_4 = NULL;
              __pyx_t_5 = 0;
              if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
                __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
                if (likely(__pyx_t_4)) {
                  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
                  __Pyx_INCREF(__pyx_t_4);
                  __Pyx_INCREF(function);
                  __Pyx_DECREF_SET(__pyx_t_3, function);
                  __pyx_t_5 = 1;
                }
              }
              {
                PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_11};
                __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
                __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
                __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
                if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 456, __pyx_L9_error)
                __Pyx_GOTREF(__pyx_t_2);
                __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
              }
              __Pyx_Raise(__pyx_t_2, 0, 0, 0);
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
              __PYX_ERR(0, 456, __pyx_L9_error)
            }
            __pyx_L14:;

    +457:                     c_servers[index].next = &c_servers[index] + 1

            (__pyx_v_c_servers[__pyx_v_index]).next = ((&(__pyx_v_c_servers[__pyx_v_index])) + 1);

    +458:                     index += 1

            __pyx_v_index = (__pyx_v_index + 1);

    +459:                     if index >= length:

            __pyx_t_7 = ((__pyx_v_index >= __pyx_v_length) != 0);
            if (__pyx_t_7) {
    /* … */
            }

    +460:                         break

              goto __pyx_L12_break;

    +461:                 c_servers[length - 1].next = NULL

          (__pyx_v_c_servers[(__pyx_v_length - 1)]).next = NULL;

    +462:                 index = cares.ares_set_servers(self.channel, c_servers)

          __pyx_v_index = ares_set_servers(__pyx_v_self->channel, __pyx_v_c_servers);

    +463:                 if index:

          __pyx_t_7 = (__pyx_v_index != 0);
          if (unlikely(__pyx_t_7)) {
    /* … */
          }
        }

    +464:                     raise ValueError(_gevent_gai_strerror(index))

            __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L9_error)
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_t_2 = __pyx_f_6gevent_8resolver_5cares__gevent_gai_strerror(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 464, __pyx_L9_error)
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L9_error)
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __Pyx_Raise(__pyx_t_1, 0, 0, 0);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __PYX_ERR(0, 464, __pyx_L9_error)

     465:             finally:

    +466:                 PyMem_Free(c_servers)

        /*finally:*/ {
          /*normal exit:*/{
            PyMem_Free(__pyx_v_c_servers);
            goto __pyx_L10;
          }
          __pyx_L9_error:;
          /*exception exit:*/{
            __Pyx_PyThreadState_declare
            __Pyx_PyThreadState_assign
            __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0;
            __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
            __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
            __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
            __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
            __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
            if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
            if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16) < 0)) __Pyx_ErrFetch(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16);
            __Pyx_XGOTREF(__pyx_t_14);
            __Pyx_XGOTREF(__pyx_t_15);
            __Pyx_XGOTREF(__pyx_t_16);
            __Pyx_XGOTREF(__pyx_t_17);
            __Pyx_XGOTREF(__pyx_t_18);
            __Pyx_XGOTREF(__pyx_t_19);
            __pyx_t_5 = __pyx_lineno; __pyx_t_12 = __pyx_clineno; __pyx_t_13 = __pyx_filename;
            {
              PyMem_Free(__pyx_v_c_servers);
            }
            if (PY_MAJOR_VERSION >= 3) {
              __Pyx_XGIVEREF(__pyx_t_17);
              __Pyx_XGIVEREF(__pyx_t_18);
              __Pyx_XGIVEREF(__pyx_t_19);
              __Pyx_ExceptionReset(__pyx_t_17, __pyx_t_18, __pyx_t_19);
            }
            __Pyx_XGIVEREF(__pyx_t_14);
            __Pyx_XGIVEREF(__pyx_t_15);
            __Pyx_XGIVEREF(__pyx_t_16);
            __Pyx_ErrRestore(__pyx_t_14, __pyx_t_15, __pyx_t_16);
            __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0;
            __pyx_lineno = __pyx_t_5; __pyx_clineno = __pyx_t_12; __pyx_filename = __pyx_t_13;
            goto __pyx_L1_error;
          }
          __pyx_L10:;
        }
      }
      __pyx_L6:;

     467:

     468:     # this crashes c-ares

     469:     #def cancel(self):

     470:     #    cares.ares_cancel(self.channel)

     471:

    +472:     cdef _sock_state_callback(self, int socket, int read, int write):

    static PyObject *__pyx_f_6gevent_8resolver_5cares_7channel__sock_state_callback(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self, int __pyx_v_socket, int __pyx_v_read, int __pyx_v_write) {
      PyObject *__pyx_v_watcher = 0;
      int __pyx_v_events;
      PyObject *__pyx_r = NULL;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("_sock_state_callback", 0);
    /* … */
      /* function exit code */
      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      goto __pyx_L0;
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_7);
      __Pyx_AddTraceback("gevent.resolver.cares.channel._sock_state_callback", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = 0;
      __pyx_L0:;
      __Pyx_XDECREF(__pyx_v_watcher);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    +473:         if not self.channel:

      __pyx_t_1 = ((!(__pyx_v_self->channel != 0)) != 0);
      if (__pyx_t_1) {
    /* … */
      }

    +474:             return

        __Pyx_XDECREF(__pyx_r);
        __pyx_r = Py_None; __Pyx_INCREF(Py_None);
        goto __pyx_L0;

    +475:         cdef object watcher = self._watchers.get(socket)

      if (unlikely(__pyx_v_self->_watchers == Py_None)) {
        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
        __PYX_ERR(0, 475, __pyx_L1_error)
      }
      __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_socket); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 475, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PyDict_GetItemDefault(__pyx_v_self->_watchers, __pyx_t_2, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 475, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_watcher = __pyx_t_3;
      __pyx_t_3 = 0;

    +476:         cdef int events = 0

      __pyx_v_events = 0;

    +477:         if read:

      __pyx_t_1 = (__pyx_v_read != 0);
      if (__pyx_t_1) {
    /* … */
      }

    +478:             events |= EV_READ

        __pyx_v_events = (__pyx_v_events | 1);

    +479:         if write:

      __pyx_t_1 = (__pyx_v_write != 0);
      if (__pyx_t_1) {
    /* … */
      }

    +480:             events |= EV_WRITE

        __pyx_v_events = (__pyx_v_events | 2);

    +481:         if watcher is None:

      __pyx_t_1 = (__pyx_v_watcher == Py_None);
      __pyx_t_4 = (__pyx_t_1 != 0);
      if (__pyx_t_4) {
    /* … */
        goto __pyx_L6;
      }

    +482:             if not events:

        __pyx_t_4 = ((!(__pyx_v_events != 0)) != 0);
        if (__pyx_t_4) {
    /* … */
        }

    +483:                 return

          __Pyx_XDECREF(__pyx_r);
          __pyx_r = Py_None; __Pyx_INCREF(Py_None);
          goto __pyx_L0;

    +484:             watcher = self.loop.io(socket, events)

        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->loop, __pyx_n_s_io); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 484, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_socket); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 484, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_events); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 484, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_7 = NULL;
        __pyx_t_8 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_2, function);
            __pyx_t_8 = 1;
          }
        }
        {
          PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_t_5, __pyx_t_6};
          __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_8, 2+__pyx_t_8);
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 484, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        }
        __Pyx_DECREF_SET(__pyx_v_watcher, __pyx_t_3);
        __pyx_t_3 = 0;

    +485:             self._watchers[socket] = watcher

        if (unlikely(__pyx_v_self->_watchers == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(0, 485, __pyx_L1_error)
        }
        __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_socket); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 485, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        if (unlikely((PyDict_SetItem(__pyx_v_self->_watchers, __pyx_t_3, __pyx_v_watcher) < 0))) __PYX_ERR(0, 485, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    +486:         elif events:

      __pyx_t_4 = (__pyx_v_events != 0);
      if (__pyx_t_4) {
    /* … */
        goto __pyx_L6;
      }

    +487:             if watcher.events == events:

        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_watcher, __pyx_n_s_events); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 487, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_events); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 487, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_6 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 487, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 487, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (__pyx_t_4) {
    /* … */
        }

    +488:                 return

          __Pyx_XDECREF(__pyx_r);
          __pyx_r = Py_None; __Pyx_INCREF(Py_None);
          goto __pyx_L0;

    +489:             watcher.stop()

        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_watcher, __pyx_n_s_stop); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 489, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_3 = NULL;
        __pyx_t_8 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
          if (likely(__pyx_t_3)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
            __Pyx_INCREF(__pyx_t_3);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_2, function);
            __pyx_t_8 = 1;
          }
        }
        {
          PyObject *__pyx_callargs[1] = {__pyx_t_3, };
          __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_8, 0+__pyx_t_8);
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 489, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    +490:             watcher.events = events

        __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_events); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 490, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__Pyx_PyObject_SetAttrStr(__pyx_v_watcher, __pyx_n_s_events, __pyx_t_6) < 0) __PYX_ERR(0, 490, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

     491:         else:

    +492:             watcher.stop()

      /*else*/ {
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_watcher, __pyx_n_s_stop); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 492, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_3 = NULL;
        __pyx_t_8 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
          if (likely(__pyx_t_3)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
            __Pyx_INCREF(__pyx_t_3);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_2, function);
            __pyx_t_8 = 1;
          }
        }
        {
          PyObject *__pyx_callargs[1] = {__pyx_t_3, };
          __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_8, 0+__pyx_t_8);
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 492, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    +493:             watcher.close()

        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_watcher, __pyx_n_s_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 493, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_3 = NULL;
        __pyx_t_8 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
          if (likely(__pyx_t_3)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
            __Pyx_INCREF(__pyx_t_3);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_2, function);
            __pyx_t_8 = 1;
          }
        }
        {
          PyObject *__pyx_callargs[1] = {__pyx_t_3, };
          __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_8, 0+__pyx_t_8);
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 493, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    +494:             self._watchers.pop(socket, None)

        if (unlikely(__pyx_v_self->_watchers == Py_None)) {
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "pop");
          __PYX_ERR(0, 494, __pyx_L1_error)
        }
        __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_socket); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 494, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_2 = __Pyx_PyDict_Pop(__pyx_v_self->_watchers, __pyx_t_6, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 494, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    +495:             if not self._watchers:

        __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_self->_watchers); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 495, __pyx_L1_error)
        __pyx_t_1 = ((!__pyx_t_4) != 0);
        if (__pyx_t_1) {
    /* … */
        }

    +496:                 self._timer.stop()

          __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_timer, __pyx_n_s_stop); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 496, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_3 = NULL;
          __pyx_t_8 = 0;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
            __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6);
            if (likely(__pyx_t_3)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
              __Pyx_INCREF(__pyx_t_3);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_6, function);
              __pyx_t_8 = 1;
            }
          }
          {
            PyObject *__pyx_callargs[1] = {__pyx_t_3, };
            __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 0+__pyx_t_8);
            __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
            if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 496, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          }
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    +497:             return

        __Pyx_XDECREF(__pyx_r);
        __pyx_r = Py_None; __Pyx_INCREF(Py_None);
        goto __pyx_L0;
      }
      __pyx_L6:;

    +498:         watcher.start(self._process_fd, watcher, pass_events=True)

      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_watcher, __pyx_n_s_start); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 498, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_process_fd); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 498, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 498, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6);
      __Pyx_INCREF(__pyx_v_watcher);
      __Pyx_GIVEREF(__pyx_v_watcher);
      PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_watcher);
      __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 498, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_pass_events, Py_True) < 0) __PYX_ERR(0, 498, __pyx_L1_error)
      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 498, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    +499:         self._timer.again(self._on_timer)

      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_timer, __pyx_n_s_again); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 499, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_on_timer); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 499, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_2)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_2);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_8 = 1;
        }
      }
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3};
        __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 499, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

     500:

    +501:     def _on_timer(self):

    /* Python wrapper */
    static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_11_on_timer(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
    static PyMethodDef __pyx_mdef_6gevent_8resolver_5cares_7channel_11_on_timer = {"_on_timer", (PyCFunction)__pyx_pw_6gevent_8resolver_5cares_7channel_11_on_timer, METH_NOARGS, 0};
    static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_11_on_timer(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("_on_timer (wrapper)", 0);
      __pyx_r = __pyx_pf_6gevent_8resolver_5cares_7channel_10_on_timer(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self));

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_6gevent_8resolver_5cares_7channel_10_on_timer(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self) {
      PyObject *__pyx_r = NULL;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("_on_timer", 0);
    /* … */
      /* function exit code */
      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }
    /* … */
      __pyx_tuple__21 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 501, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__21);
      __Pyx_GIVEREF(__pyx_tuple__21);
    /* … */
      __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6gevent_8resolver_5cares_7channel_11_on_timer, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_channel__on_timer, NULL, __pyx_n_s_gevent_resolver_cares, __pyx_d, ((PyObject *)__pyx_codeobj__22)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 501, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_8resolver_5cares_channel->tp_dict, __pyx_n_s_on_timer, __pyx_t_2) < 0) __PYX_ERR(0, 501, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      PyType_Modified(__pyx_ptype_6gevent_8resolver_5cares_channel);
      __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__21, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_resolver_cares_pyx, __pyx_n_s_on_timer, 501, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(0, 501, __pyx_L1_error)

    +502:         cares.ares_process_fd(self.channel, cares.ARES_SOCKET_BAD, cares.ARES_SOCKET_BAD)

      ares_process_fd(__pyx_v_self->channel, ARES_SOCKET_BAD, ARES_SOCKET_BAD);

     503:

    +504:     def _process_fd(self, int events, object watcher):

    /* Python wrapper */
    static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_13_process_fd(PyObject *__pyx_v_self,
    #if CYTHON_METH_FASTCALL
    PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
    #else
    PyObject *__pyx_args, PyObject *__pyx_kwds
    #endif
    ); /*proto*/
    static PyMethodDef __pyx_mdef_6gevent_8resolver_5cares_7channel_13_process_fd = {"_process_fd", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6gevent_8resolver_5cares_7channel_13_process_fd, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
    static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_13_process_fd(PyObject *__pyx_v_self,
    #if CYTHON_METH_FASTCALL
    PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
    #else
    PyObject *__pyx_args, PyObject *__pyx_kwds
    #endif
    ) {
      int __pyx_v_events;
      PyObject *__pyx_v_watcher = 0;
      #if !CYTHON_METH_FASTCALL
      CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
      #endif
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("_process_fd (wrapper)", 0);
      {
        #if CYTHON_USE_MODULE_STATE
        PyObject **__pyx_pyargnames[] = {&__pyx_n_s_events,&__pyx_n_s_watcher,0};
        #else
        static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_events,&__pyx_n_s_watcher,0};
        #endif
        PyObject* values[2] = {0,0};
        if (__pyx_kwds) {
          Py_ssize_t kw_args;
          switch (__pyx_nargs) {
            case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
            CYTHON_FALLTHROUGH;
            case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
            CYTHON_FALLTHROUGH;
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
          switch (__pyx_nargs) {
            case  0:
            if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_events)) != 0)) kw_args--;
            else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 504, __pyx_L3_error)
            else goto __pyx_L5_argtuple_error;
            CYTHON_FALLTHROUGH;
            case  1:
            if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_watcher)) != 0)) kw_args--;
            else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 504, __pyx_L3_error)
            else {
              __Pyx_RaiseArgtupleInvalid("_process_fd", 1, 2, 2, 1); __PYX_ERR(0, 504, __pyx_L3_error)
            }
          }
          if (unlikely(kw_args > 0)) {
            const Py_ssize_t kwd_pos_args = __pyx_nargs;
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_process_fd") < 0)) __PYX_ERR(0, 504, __pyx_L3_error)
          }
        } else if (unlikely(__pyx_nargs != 2)) {
          goto __pyx_L5_argtuple_error;
        } else {
          values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
          values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        }
        __pyx_v_events = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_events == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 504, __pyx_L3_error)
        __pyx_v_watcher = values[1];
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("_process_fd", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 504, __pyx_L3_error)
      __pyx_L3_error:;
      __Pyx_AddTraceback("gevent.resolver.cares.channel._process_fd", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_6gevent_8resolver_5cares_7channel_12_process_fd(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self), __pyx_v_events, __pyx_v_watcher);
      int __pyx_lineno = 0;
      const char *__pyx_filename = NULL;
      int __pyx_clineno = 0;

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_6gevent_8resolver_5cares_7channel_12_process_fd(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self, int __pyx_v_events, PyObject *__pyx_v_watcher) {
      int __pyx_v_read_fd;
      int __pyx_v_write_fd;
      PyObject *__pyx_r = NULL;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("_process_fd", 0);
    /* … */
      /* function exit code */
      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      goto __pyx_L0;
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_AddTraceback("gevent.resolver.cares.channel._process_fd", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }
    /* … */
      __pyx_tuple__23 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_events, __pyx_n_s_watcher, __pyx_n_s_read_fd, __pyx_n_s_write_fd); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 504, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__23);
      __Pyx_GIVEREF(__pyx_tuple__23);
    /* … */
      __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6gevent_8resolver_5cares_7channel_13_process_fd, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_channel__process_fd, NULL, __pyx_n_s_gevent_resolver_cares, __pyx_d, ((PyObject *)__pyx_codeobj__24)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 504, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_8resolver_5cares_channel->tp_dict, __pyx_n_s_process_fd, __pyx_t_2) < 0) __PYX_ERR(0, 504, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      PyType_Modified(__pyx_ptype_6gevent_8resolver_5cares_channel);
      __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__23, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_resolver_cares_pyx, __pyx_n_s_process_fd, 504, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) __PYX_ERR(0, 504, __pyx_L1_error)

    +505:         if not self.channel:

      __pyx_t_1 = ((!(__pyx_v_self->channel != 0)) != 0);
      if (__pyx_t_1) {
    /* … */
      }

    +506:             return

        __Pyx_XDECREF(__pyx_r);
        __pyx_r = Py_None; __Pyx_INCREF(Py_None);
        goto __pyx_L0;

    +507:         cdef int read_fd = watcher.fd

      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_watcher, __pyx_n_s_fd); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 507, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 507, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_read_fd = __pyx_t_3;

    +508:         cdef int write_fd = read_fd

      __pyx_v_write_fd = __pyx_v_read_fd;

    +509:         if not (events & EV_READ):

      __pyx_t_1 = ((!((__pyx_v_events & 1) != 0)) != 0);
      if (__pyx_t_1) {
    /* … */
      }

    +510:             read_fd = cares.ARES_SOCKET_BAD

        __pyx_v_read_fd = ARES_SOCKET_BAD;

    +511:         if not (events & EV_WRITE):

      __pyx_t_1 = ((!((__pyx_v_events & 2) != 0)) != 0);
      if (__pyx_t_1) {
    /* … */
      }

    +512:             write_fd = cares.ARES_SOCKET_BAD

        __pyx_v_write_fd = ARES_SOCKET_BAD;

    +513:         cares.ares_process_fd(self.channel, read_fd, write_fd)

      ares_process_fd(__pyx_v_self->channel, __pyx_v_read_fd, __pyx_v_write_fd);

     514:

     515:     @staticmethod

    +516:     cdef void _gethostbyname_or_byaddr_cb(void *arg, int status, int timeouts, hostent* host):

    static void __pyx_f_6gevent_8resolver_5cares_7channel__gethostbyname_or_byaddr_cb(void *__pyx_v_arg, int __pyx_v_status, CYTHON_UNUSED int __pyx_v_timeouts, struct hostent *__pyx_v_host) {
      struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_channel = 0;
      PyObject *__pyx_v_callback = 0;
      PyObject *__pyx_v_host_result = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("_gethostbyname_or_byaddr_cb", 0);
    /* … */
      /* function exit code */
      goto __pyx_L0;
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_9);
      __Pyx_XDECREF(__pyx_t_14);
      __Pyx_XDECREF(__pyx_t_15);
      __Pyx_XDECREF(__pyx_t_16);
      __Pyx_XDECREF(__pyx_t_17);
      __Pyx_WriteUnraisable("gevent.resolver.cares.channel._gethostbyname_or_byaddr_cb", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
      __pyx_L0:;
      __Pyx_XDECREF((PyObject *)__pyx_v_channel);
      __Pyx_XDECREF(__pyx_v_callback);
      __Pyx_XDECREF(__pyx_v_host_result);
      __Pyx_RefNannyFinishContext();
    }

     517:         cdef channel channel

     518:         cdef object callback

    +519:         channel, callback = <tuple>arg

      __pyx_t_1 = ((PyObject *)__pyx_v_arg);
      __Pyx_INCREF(__pyx_t_1);
      if (likely(__pyx_t_1 != Py_None)) {
        PyObject* sequence = __pyx_t_1;
        Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
        if (unlikely(size != 2)) {
          if (size > 2) __Pyx_RaiseTooManyValuesError(2);
          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
          __PYX_ERR(0, 519, __pyx_L1_error)
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
        __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        #else
        __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 519, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 519, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      } else {
        __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(0, 519, __pyx_L1_error)
      }
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_6gevent_8resolver_5cares_channel))))) __PYX_ERR(0, 519, __pyx_L1_error)
      __pyx_v_channel = ((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_v_callback = __pyx_t_3;
      __pyx_t_3 = 0;

    +520:         Py_DECREF(<tuple>arg)

      Py_DECREF(((PyObject *)__pyx_v_arg));

     521:         cdef object host_result

    +522:         try:

      {
        /*try:*/ {
    /* … */
        }
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        goto __pyx_L8_try_end;
        __pyx_L3_error:;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
        __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
        __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    /* … */
        __Pyx_XGIVEREF(__pyx_t_4);
        __Pyx_XGIVEREF(__pyx_t_5);
        __Pyx_XGIVEREF(__pyx_t_6);
        __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
        goto __pyx_L1_error;
        __pyx_L4_exception_handled:;
        __Pyx_XGIVEREF(__pyx_t_4);
        __Pyx_XGIVEREF(__pyx_t_5);
        __Pyx_XGIVEREF(__pyx_t_6);
        __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
        __pyx_L8_try_end:;
      }

    +523:             if status or not host:

          __pyx_t_8 = (__pyx_v_status != 0);
          if (!__pyx_t_8) {
          } else {
            __pyx_t_7 = __pyx_t_8;
            goto __pyx_L10_bool_binop_done;
          }
          __pyx_t_8 = ((!(__pyx_v_host != 0)) != 0);
          __pyx_t_7 = __pyx_t_8;
          __pyx_L10_bool_binop_done:;
          if (__pyx_t_7) {
    /* … */
            goto __pyx_L9;
          }

    +524:                 callback(Result(None, _gevent_herror_from_status(status)))

            __pyx_t_3 = __pyx_f_6gevent_8resolver_5cares__gevent_herror_from_status(__pyx_v_status); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 524, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_3);
            __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 524, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_INCREF(Py_None);
            __Pyx_GIVEREF(Py_None);
            PyTuple_SET_ITEM(__pyx_t_2, 0, Py_None);
            __Pyx_GIVEREF(__pyx_t_3);
            PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
            __pyx_t_3 = 0;
            __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_8resolver_5cares_Result), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 524, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __Pyx_INCREF(__pyx_v_callback);
            __pyx_t_2 = __pyx_v_callback; __pyx_t_9 = NULL;
            __pyx_t_10 = 0;
            if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
              __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_2);
              if (likely(__pyx_t_9)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
                __Pyx_INCREF(__pyx_t_9);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_2, function);
                __pyx_t_10 = 1;
              }
            }
            {
              PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_3};
              __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10);
              __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
              __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
              if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 524, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_1);
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            }
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

     525:             else:

    +526:                 try:

          /*else*/ {
            {
              /*try:*/ {
    /* … */
              }
    /* … */
              __Pyx_XGIVEREF(__pyx_t_11);
              __Pyx_XGIVEREF(__pyx_t_12);
              __Pyx_XGIVEREF(__pyx_t_13);
              __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13);
              goto __pyx_L3_error;
              __pyx_L13_exception_handled:;
              __Pyx_XGIVEREF(__pyx_t_11);
              __Pyx_XGIVEREF(__pyx_t_12);
              __Pyx_XGIVEREF(__pyx_t_13);
              __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13);
              __pyx_L17_try_end:;
            }
          }
          __pyx_L9:;

    +527:                     host_result = ares_host_result(host.h_addrtype,

                __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ares_host_result); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 527, __pyx_L12_error)
                __Pyx_GOTREF(__pyx_t_2);
                __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_host->h_addrtype); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 527, __pyx_L12_error)
                __Pyx_GOTREF(__pyx_t_3);

    +528:                                                    (_as_str(host.h_name),

                __pyx_t_9 = __pyx_f_6gevent_8resolver_5cares__as_str(__pyx_v_host->h_name); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 528, __pyx_L12_error)
                __Pyx_GOTREF(__pyx_t_9);
    /* … */
                __pyx_t_16 = PyTuple_New(3); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 528, __pyx_L12_error)
                __Pyx_GOTREF(__pyx_t_16);
                __Pyx_GIVEREF(__pyx_t_9);
                PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_9);
                __Pyx_GIVEREF(__pyx_t_14);
                PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_t_14);
                __Pyx_GIVEREF(__pyx_t_15);
                PyTuple_SET_ITEM(__pyx_t_16, 2, __pyx_t_15);
                __pyx_t_9 = 0;
                __pyx_t_14 = 0;
                __pyx_t_15 = 0;
                __pyx_t_15 = NULL;
                __pyx_t_10 = 0;
                if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
                  __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_2);
                  if (likely(__pyx_t_15)) {
                    PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
                    __Pyx_INCREF(__pyx_t_15);
                    __Pyx_INCREF(function);
                    __Pyx_DECREF_SET(__pyx_t_2, function);
                    __pyx_t_10 = 1;
                  }
                }
                {
                  PyObject *__pyx_callargs[3] = {__pyx_t_15, __pyx_t_3, __pyx_t_16};
                  __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_10, 2+__pyx_t_10);
                  __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
                  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
                  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
                  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 527, __pyx_L12_error)
                  __Pyx_GOTREF(__pyx_t_1);
                  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                }
                __pyx_v_host_result = __pyx_t_1;
                __pyx_t_1 = 0;

    +529:                                                     _parse_h_aliases(host),

                __pyx_t_14 = __pyx_f_6gevent_8resolver_5cares__parse_h_aliases(__pyx_v_host); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 529, __pyx_L12_error)
                __Pyx_GOTREF(__pyx_t_14);

    +530:                                                     _parse_h_addr_list(host)))

                __pyx_t_15 = __pyx_f_6gevent_8resolver_5cares__parse_h_addr_list(__pyx_v_host); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 530, __pyx_L12_error)
                __Pyx_GOTREF(__pyx_t_15);

    +531:                 except:

              /*except:*/ {
                __Pyx_AddTraceback("gevent.resolver.cares.channel._gethostbyname_or_byaddr_cb", __pyx_clineno, __pyx_lineno, __pyx_filename);
                if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_16, &__pyx_t_2) < 0) __PYX_ERR(0, 531, __pyx_L14_except_error)
                __Pyx_GOTREF(__pyx_t_1);
                __Pyx_GOTREF(__pyx_t_16);
                __Pyx_GOTREF(__pyx_t_2);

    +532:                     callback(Result(None, sys.exc_info()[1]))

                __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_sys); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 532, __pyx_L14_except_error)
                __Pyx_GOTREF(__pyx_t_14);
                __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_exc_info); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 532, __pyx_L14_except_error)
                __Pyx_GOTREF(__pyx_t_9);
                __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
                __pyx_t_14 = NULL;
                __pyx_t_10 = 0;
                if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
                  __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_9);
                  if (likely(__pyx_t_14)) {
                    PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
                    __Pyx_INCREF(__pyx_t_14);
                    __Pyx_INCREF(function);
                    __Pyx_DECREF_SET(__pyx_t_9, function);
                    __pyx_t_10 = 1;
                  }
                }
                {
                  PyObject *__pyx_callargs[1] = {__pyx_t_14, };
                  __pyx_t_15 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_10, 0+__pyx_t_10);
                  __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
                  if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 532, __pyx_L14_except_error)
                  __Pyx_GOTREF(__pyx_t_15);
                  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
                }
                __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_15, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 532, __pyx_L14_except_error)
                __Pyx_GOTREF(__pyx_t_9);
                __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
                __pyx_t_15 = PyTuple_New(2); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 532, __pyx_L14_except_error)
                __Pyx_GOTREF(__pyx_t_15);
                __Pyx_INCREF(Py_None);
                __Pyx_GIVEREF(Py_None);
                PyTuple_SET_ITEM(__pyx_t_15, 0, Py_None);
                __Pyx_GIVEREF(__pyx_t_9);
                PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_t_9);
                __pyx_t_9 = 0;
                __pyx_t_9 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_8resolver_5cares_Result), __pyx_t_15, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 532, __pyx_L14_except_error)
                __Pyx_GOTREF(__pyx_t_9);
                __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
                __Pyx_INCREF(__pyx_v_callback);
                __pyx_t_15 = __pyx_v_callback; __pyx_t_14 = NULL;
                __pyx_t_10 = 0;
                if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_15))) {
                  __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_15);
                  if (likely(__pyx_t_14)) {
                    PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15);
                    __Pyx_INCREF(__pyx_t_14);
                    __Pyx_INCREF(function);
                    __Pyx_DECREF_SET(__pyx_t_15, function);
                    __pyx_t_10 = 1;
                  }
                }
                {
                  PyObject *__pyx_callargs[2] = {__pyx_t_14, __pyx_t_9};
                  __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_15, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10);
                  __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
                  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
                  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 532, __pyx_L14_except_error)
                  __Pyx_GOTREF(__pyx_t_3);
                  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
                }
                __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
                __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
                __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
                __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
                goto __pyx_L13_exception_handled;
              }
              __pyx_L14_except_error:;

     533:                 else:

    +534:                     callback(Result(host_result))

              /*else:*/ {
                __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_6gevent_8resolver_5cares_Result), __pyx_v_host_result); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 534, __pyx_L14_except_error)
                __Pyx_GOTREF(__pyx_t_2);
                __Pyx_INCREF(__pyx_v_callback);
                __pyx_t_16 = __pyx_v_callback; __pyx_t_3 = NULL;
                __pyx_t_10 = 0;
                if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_16))) {
                  __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_16);
                  if (likely(__pyx_t_3)) {
                    PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_16);
                    __Pyx_INCREF(__pyx_t_3);
                    __Pyx_INCREF(function);
                    __Pyx_DECREF_SET(__pyx_t_16, function);
                    __pyx_t_10 = 1;
                  }
                }
                {
                  PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_2};
                  __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_16, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10);
                  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
                  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 534, __pyx_L14_except_error)
                  __Pyx_GOTREF(__pyx_t_1);
                  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
                }
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
              }
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
              __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
              goto __pyx_L17_try_end;
              __pyx_L12_error:;
              __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
              __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
              __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
              __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
              __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
              __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
              __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    +535:         except:

        /*except:*/ {
          __Pyx_AddTraceback("gevent.resolver.cares.channel._gethostbyname_or_byaddr_cb", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_16, &__pyx_t_1) < 0) __PYX_ERR(0, 535, __pyx_L5_except_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_GOTREF(__pyx_t_16);
          __Pyx_GOTREF(__pyx_t_1);

    +536:             channel.loop.handle_error(callback, *sys.exc_info())

          __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_channel->loop, __pyx_n_s_handle_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 536, __pyx_L5_except_error)
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_15 = PyTuple_New(1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 536, __pyx_L5_except_error)
          __Pyx_GOTREF(__pyx_t_15);
          __Pyx_INCREF(__pyx_v_callback);
          __Pyx_GIVEREF(__pyx_v_callback);
          PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_v_callback);
          __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_sys); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 536, __pyx_L5_except_error)
          __Pyx_GOTREF(__pyx_t_14);
          __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_exc_info); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 536, __pyx_L5_except_error)
          __Pyx_GOTREF(__pyx_t_17);
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          __pyx_t_14 = NULL;
          __pyx_t_10 = 0;
          if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_17))) {
            __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_17);
            if (likely(__pyx_t_14)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_17);
              __Pyx_INCREF(__pyx_t_14);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_17, function);
              __pyx_t_10 = 1;
            }
          }
          {
            PyObject *__pyx_callargs[1] = {__pyx_t_14, };
            __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_17, __pyx_callargs+1-__pyx_t_10, 0+__pyx_t_10);
            __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
            if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 536, __pyx_L5_except_error)
            __Pyx_GOTREF(__pyx_t_9);
            __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
          }
          __pyx_t_17 = __Pyx_PySequence_Tuple(__pyx_t_9); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 536, __pyx_L5_except_error)
          __Pyx_GOTREF(__pyx_t_17);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = PyNumber_Add(__pyx_t_15, __pyx_t_17); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 536, __pyx_L5_except_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
          __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
          __pyx_t_17 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_9, NULL); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 536, __pyx_L5_except_error)
          __Pyx_GOTREF(__pyx_t_17);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          goto __pyx_L4_exception_handled;
        }
        __pyx_L5_except_error:;

     537:

     538:

    +539:     def gethostbyname(self, object callback, char* name, int family=AF_INET):

    /* Python wrapper */
    static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_15gethostbyname(PyObject *__pyx_v_self,
    #if CYTHON_METH_FASTCALL
    PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
    #else
    PyObject *__pyx_args, PyObject *__pyx_kwds
    #endif
    ); /*proto*/
    static PyMethodDef __pyx_mdef_6gevent_8resolver_5cares_7channel_15gethostbyname = {"gethostbyname", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6gevent_8resolver_5cares_7channel_15gethostbyname, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
    static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_15gethostbyname(PyObject *__pyx_v_self,
    #if CYTHON_METH_FASTCALL
    PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
    #else
    PyObject *__pyx_args, PyObject *__pyx_kwds
    #endif
    ) {
      PyObject *__pyx_v_callback = 0;
      char *__pyx_v_name;
      int __pyx_v_family;
      #if !CYTHON_METH_FASTCALL
      CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
      #endif
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("gethostbyname (wrapper)", 0);
      {
        #if CYTHON_USE_MODULE_STATE
        PyObject **__pyx_pyargnames[] = {&__pyx_n_s_callback,&__pyx_n_s_name_2,&__pyx_n_s_family,0};
        #else
        static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_callback,&__pyx_n_s_name_2,&__pyx_n_s_family,0};
        #endif
        PyObject* values[3] = {0,0,0};
        if (__pyx_kwds) {
          Py_ssize_t kw_args;
          switch (__pyx_nargs) {
            case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
            CYTHON_FALLTHROUGH;
            case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
            CYTHON_FALLTHROUGH;
            case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
            CYTHON_FALLTHROUGH;
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
          switch (__pyx_nargs) {
            case  0:
            if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_callback)) != 0)) kw_args--;
            else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 539, __pyx_L3_error)
            else goto __pyx_L5_argtuple_error;
            CYTHON_FALLTHROUGH;
            case  1:
            if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name_2)) != 0)) kw_args--;
            else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 539, __pyx_L3_error)
            else {
              __Pyx_RaiseArgtupleInvalid("gethostbyname", 0, 2, 3, 1); __PYX_ERR(0, 539, __pyx_L3_error)
            }
            CYTHON_FALLTHROUGH;
            case  2:
            if (kw_args > 0) {
              PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_family);
              if (value) { values[2] = value; kw_args--; }
              else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 539, __pyx_L3_error)
            }
          }
          if (unlikely(kw_args > 0)) {
            const Py_ssize_t kwd_pos_args = __pyx_nargs;
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "gethostbyname") < 0)) __PYX_ERR(0, 539, __pyx_L3_error)
          }
        } else {
          switch (__pyx_nargs) {
            case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
            CYTHON_FALLTHROUGH;
            case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
            values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
            break;
            default: goto __pyx_L5_argtuple_error;
          }
        }
        __pyx_v_callback = values[0];
        __pyx_v_name = __Pyx_PyObject_AsWritableString(values[1]); if (unlikely((!__pyx_v_name) && PyErr_Occurred())) __PYX_ERR(0, 539, __pyx_L3_error)
        if (values[2]) {
          __pyx_v_family = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_family == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 539, __pyx_L3_error)
        } else {
          __pyx_v_family = __pyx_k__3;
        }
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("gethostbyname", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 539, __pyx_L3_error)
      __pyx_L3_error:;
      __Pyx_AddTraceback("gevent.resolver.cares.channel.gethostbyname", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_6gevent_8resolver_5cares_7channel_14gethostbyname(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self), __pyx_v_callback, __pyx_v_name, __pyx_v_family);
      int __pyx_lineno = 0;
      const char *__pyx_filename = NULL;
      int __pyx_clineno = 0;

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_6gevent_8resolver_5cares_7channel_14gethostbyname(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self, PyObject *__pyx_v_callback, char *__pyx_v_name, int __pyx_v_family) {
      PyObject *__pyx_v_arg = 0;
      PyObject *__pyx_r = NULL;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("gethostbyname", 0);
    /* … */
      /* function exit code */
      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      goto __pyx_L0;
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_5);
      __Pyx_AddTraceback("gevent.resolver.cares.channel.gethostbyname", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XDECREF(__pyx_v_arg);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }
    /* … */
      __pyx_k__3 = AF_INET;
    /* … */
      __pyx_tuple__25 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_callback, __pyx_n_s_name_2, __pyx_n_s_family, __pyx_n_s_arg); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 539, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__25);
      __Pyx_GIVEREF(__pyx_tuple__25);
      __pyx_t_2 = __Pyx_PyInt_From_int(AF_INET); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 539, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_28 = PyTuple_New(1); if (unlikely(!__pyx_t_28)) __PYX_ERR(0, 539, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_28);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_28, 0, __pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6gevent_8resolver_5cares_7channel_15gethostbyname, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_channel_gethostbyname, NULL, __pyx_n_s_gevent_resolver_cares, __pyx_d, ((PyObject *)__pyx_codeobj__26)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 539, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_t_28);
      __Pyx_DECREF(__pyx_t_28); __pyx_t_28 = 0;
      if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_8resolver_5cares_channel->tp_dict, __pyx_n_s_gethostbyname, __pyx_t_2) < 0) __PYX_ERR(0, 539, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      PyType_Modified(__pyx_ptype_6gevent_8resolver_5cares_channel);
      __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__25, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_resolver_cares_pyx, __pyx_n_s_gethostbyname, 539, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(0, 539, __pyx_L1_error)

    +540:         if not self.channel:

      __pyx_t_1 = ((!(__pyx_v_self->channel != 0)) != 0);
      if (unlikely(__pyx_t_1)) {
    /* … */
      }

    +541:             raise gaierror(cares.ARES_EDESTRUCTION, 'this ares channel has been destroyed')

        __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_gaierror); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 541, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_4 = __Pyx_PyInt_From_int(ARES_EDESTRUCTION); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 541, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_5 = NULL;
        __pyx_t_6 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_5)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_5);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
            __pyx_t_6 = 1;
          }
        }
        {
          PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_t_4, __pyx_kp_s_this_ares_channel_has_been_destr};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6);
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 541, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        }
        __Pyx_Raise(__pyx_t_2, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __PYX_ERR(0, 541, __pyx_L1_error)

     542:         # note that for file lookups still AF_INET can be returned for AF_INET6 request

    +543:         cdef object arg = (self, callback)

      __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 543, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF((PyObject *)__pyx_v_self);
      __Pyx_GIVEREF((PyObject *)__pyx_v_self);
      PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self));
      __Pyx_INCREF(__pyx_v_callback);
      __Pyx_GIVEREF(__pyx_v_callback);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_callback);
      __pyx_v_arg = __pyx_t_2;
      __pyx_t_2 = 0;

    +544:         Py_INCREF(arg)

      Py_INCREF(__pyx_v_arg);

    +545:         cares.ares_gethostbyname(self.channel, name, family,

      ares_gethostbyname(__pyx_v_self->channel, __pyx_v_name, __pyx_v_family, ((void *)__pyx_f_6gevent_8resolver_5cares_7channel__gethostbyname_or_byaddr_cb), ((void *)__pyx_v_arg));

     546:                                  <void*>channel._gethostbyname_or_byaddr_cb, <void*>arg)

     547:

    +548:     def gethostbyaddr(self, object callback, char* addr):

    /* Python wrapper */
    static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_17gethostbyaddr(PyObject *__pyx_v_self,
    #if CYTHON_METH_FASTCALL
    PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
    #else
    PyObject *__pyx_args, PyObject *__pyx_kwds
    #endif
    ); /*proto*/
    static PyMethodDef __pyx_mdef_6gevent_8resolver_5cares_7channel_17gethostbyaddr = {"gethostbyaddr", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6gevent_8resolver_5cares_7channel_17gethostbyaddr, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
    static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_17gethostbyaddr(PyObject *__pyx_v_self,
    #if CYTHON_METH_FASTCALL
    PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
    #else
    PyObject *__pyx_args, PyObject *__pyx_kwds
    #endif
    ) {
      PyObject *__pyx_v_callback = 0;
      char *__pyx_v_addr;
      #if !CYTHON_METH_FASTCALL
      CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
      #endif
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("gethostbyaddr (wrapper)", 0);
      {
        #if CYTHON_USE_MODULE_STATE
        PyObject **__pyx_pyargnames[] = {&__pyx_n_s_callback,&__pyx_n_s_addr,0};
        #else
        static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_callback,&__pyx_n_s_addr,0};
        #endif
        PyObject* values[2] = {0,0};
        if (__pyx_kwds) {
          Py_ssize_t kw_args;
          switch (__pyx_nargs) {
            case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
            CYTHON_FALLTHROUGH;
            case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
            CYTHON_FALLTHROUGH;
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
          switch (__pyx_nargs) {
            case  0:
            if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_callback)) != 0)) kw_args--;
            else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 548, __pyx_L3_error)
            else goto __pyx_L5_argtuple_error;
            CYTHON_FALLTHROUGH;
            case  1:
            if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_addr)) != 0)) kw_args--;
            else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 548, __pyx_L3_error)
            else {
              __Pyx_RaiseArgtupleInvalid("gethostbyaddr", 1, 2, 2, 1); __PYX_ERR(0, 548, __pyx_L3_error)
            }
          }
          if (unlikely(kw_args > 0)) {
            const Py_ssize_t kwd_pos_args = __pyx_nargs;
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "gethostbyaddr") < 0)) __PYX_ERR(0, 548, __pyx_L3_error)
          }
        } else if (unlikely(__pyx_nargs != 2)) {
          goto __pyx_L5_argtuple_error;
        } else {
          values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
          values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        }
        __pyx_v_callback = values[0];
        __pyx_v_addr = __Pyx_PyObject_AsWritableString(values[1]); if (unlikely((!__pyx_v_addr) && PyErr_Occurred())) __PYX_ERR(0, 548, __pyx_L3_error)
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("gethostbyaddr", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 548, __pyx_L3_error)
      __pyx_L3_error:;
      __Pyx_AddTraceback("gevent.resolver.cares.channel.gethostbyaddr", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_6gevent_8resolver_5cares_7channel_16gethostbyaddr(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self), __pyx_v_callback, __pyx_v_addr);
      int __pyx_lineno = 0;
      const char *__pyx_filename = NULL;
      int __pyx_clineno = 0;

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_6gevent_8resolver_5cares_7channel_16gethostbyaddr(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self, PyObject *__pyx_v_callback, char *__pyx_v_addr) {
      char __pyx_v_addr_packed[16];
      int __pyx_v_family;
      int __pyx_v_length;
      PyObject *__pyx_v_arg = 0;
      PyObject *__pyx_r = NULL;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("gethostbyaddr", 0);
    /* … */
      /* function exit code */
      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      goto __pyx_L0;
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_5);
      __Pyx_AddTraceback("gevent.resolver.cares.channel.gethostbyaddr", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XDECREF(__pyx_v_arg);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }
    /* … */
      __pyx_tuple__27 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_callback, __pyx_n_s_addr, __pyx_n_s_addr_packed, __pyx_n_s_family, __pyx_n_s_length, __pyx_n_s_arg); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 548, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__27);
      __Pyx_GIVEREF(__pyx_tuple__27);
    /* … */
      __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6gevent_8resolver_5cares_7channel_17gethostbyaddr, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_channel_gethostbyaddr, NULL, __pyx_n_s_gevent_resolver_cares, __pyx_d, ((PyObject *)__pyx_codeobj__28)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 548, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_8resolver_5cares_channel->tp_dict, __pyx_n_s_gethostbyaddr, __pyx_t_2) < 0) __PYX_ERR(0, 548, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      PyType_Modified(__pyx_ptype_6gevent_8resolver_5cares_channel);
      __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_resolver_cares_pyx, __pyx_n_s_gethostbyaddr, 548, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) __PYX_ERR(0, 548, __pyx_L1_error)

    +549:         if not self.channel:

      __pyx_t_1 = ((!(__pyx_v_self->channel != 0)) != 0);
      if (unlikely(__pyx_t_1)) {
    /* … */
      }

    +550:             raise gaierror(cares.ARES_EDESTRUCTION, 'this ares channel has been destroyed')

        __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_gaierror); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 550, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_4 = __Pyx_PyInt_From_int(ARES_EDESTRUCTION); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 550, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_5 = NULL;
        __pyx_t_6 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_5)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_5);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
            __pyx_t_6 = 1;
          }
        }
        {
          PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_t_4, __pyx_kp_s_this_ares_channel_has_been_destr};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6);
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 550, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        }
        __Pyx_Raise(__pyx_t_2, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __PYX_ERR(0, 550, __pyx_L1_error)

     551:         # will guess the family

     552:         cdef char addr_packed[16]

     553:         cdef int family

     554:         cdef int length

    +555:         if cares.ares_inet_pton(AF_INET, addr, addr_packed) > 0:

      __pyx_t_1 = ((ares_inet_pton(AF_INET, __pyx_v_addr, __pyx_v_addr_packed) > 0) != 0);
      if (__pyx_t_1) {
    /* … */
        goto __pyx_L4;
      }

    +556:             family = AF_INET

        __pyx_v_family = AF_INET;

    +557:             length = 4

        __pyx_v_length = 4;

    +558:         elif cares.ares_inet_pton(AF_INET6, addr, addr_packed) > 0:

      __pyx_t_1 = ((ares_inet_pton(AF_INET6, __pyx_v_addr, __pyx_v_addr_packed) > 0) != 0);
      if (likely(__pyx_t_1)) {
    /* … */
        goto __pyx_L4;
      }

    +559:             family = AF_INET6

        __pyx_v_family = AF_INET6;

    +560:             length = 16

        __pyx_v_length = 16;

     561:         else:

    +562:             raise InvalidIP(repr(addr))

      /*else*/ {
        __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_InvalidIP); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 562, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_addr); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 562, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_5 = PyObject_Repr(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 562, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = NULL;
        __pyx_t_6 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
            __pyx_t_6 = 1;
          }
        }
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 562, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        }
        __Pyx_Raise(__pyx_t_2, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __PYX_ERR(0, 562, __pyx_L1_error)
      }
      __pyx_L4:;

    +563:         cdef object arg = (self, callback)

      __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 563, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF((PyObject *)__pyx_v_self);
      __Pyx_GIVEREF((PyObject *)__pyx_v_self);
      PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self));
      __Pyx_INCREF(__pyx_v_callback);
      __Pyx_GIVEREF(__pyx_v_callback);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_callback);
      __pyx_v_arg = __pyx_t_2;
      __pyx_t_2 = 0;

    +564:         Py_INCREF(arg)

      Py_INCREF(__pyx_v_arg);

    +565:         cares.ares_gethostbyaddr(self.channel, addr_packed, length, family,

      ares_gethostbyaddr(__pyx_v_self->channel, __pyx_v_addr_packed, __pyx_v_length, __pyx_v_family, ((void *)__pyx_f_6gevent_8resolver_5cares_7channel__gethostbyname_or_byaddr_cb), ((void *)__pyx_v_arg));

     566:                                  <void*>channel._gethostbyname_or_byaddr_cb, <void*>arg)

     567:

    +568:     cpdef _getnameinfo(self, object callback, tuple sockaddr, int flags):

    static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_19_getnameinfo(PyObject *__pyx_v_self,
    #if CYTHON_METH_FASTCALL
    PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
    #else
    PyObject *__pyx_args, PyObject *__pyx_kwds
    #endif
    ); /*proto*/
    static PyObject *__pyx_f_6gevent_8resolver_5cares_7channel__getnameinfo(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_sockaddr, int __pyx_v_flags, int __pyx_skip_dispatch) {
      char *__pyx_v_hostp;
      int __pyx_v_port;
      int __pyx_v_flowinfo;
      int __pyx_v_scope_id;
      struct sockaddr_in6 __pyx_v_sa6;
      int __pyx_v_length;
      PyObject *__pyx_v_arg = 0;
      struct sockaddr *__pyx_v_x;
      PyObject *__pyx_r = NULL;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("_getnameinfo", 0);
      /* Check if called by wrapper */
      if (unlikely(__pyx_skip_dispatch)) ;
      /* Check if overridden in Python */
      else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
        #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
        static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
        if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
          PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
          #endif
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getnameinfo); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 568, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          #ifdef __Pyx_CyFunction_USED
          if (!__Pyx_IsCyOrPyCFunction(__pyx_t_1)
          #else
          if (!PyCFunction_Check(__pyx_t_1)
          #endif
                  || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_8resolver_5cares_7channel_19_getnameinfo)) {
            __Pyx_XDECREF(__pyx_r);
            __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 568, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_1);
            __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
            __pyx_t_6 = 0;
            if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
              __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
              if (likely(__pyx_t_5)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
                __Pyx_INCREF(__pyx_t_5);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_4, function);
                __pyx_t_6 = 1;
              }
            }
            {
              PyObject *__pyx_callargs[4] = {__pyx_t_5, __pyx_v_callback, __pyx_v_sockaddr, __pyx_t_3};
              __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 3+__pyx_t_6);
              __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
              __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
              if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 568, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_2);
              __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            }
            __pyx_r = __pyx_t_2;
            __pyx_t_2 = 0;
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            goto __pyx_L0;
          }
          #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
          __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
          __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
          if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
            __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
          }
          #endif
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
        }
        #endif
      }
    /* … */
      /* function exit code */
      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      goto __pyx_L0;
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_5);
      __Pyx_AddTraceback("gevent.resolver.cares.channel._getnameinfo", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = 0;
      __pyx_L0:;
      __Pyx_XDECREF(__pyx_v_arg);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_19_getnameinfo(PyObject *__pyx_v_self,
    #if CYTHON_METH_FASTCALL
    PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
    #else
    PyObject *__pyx_args, PyObject *__pyx_kwds
    #endif
    ); /*proto*/
    static PyMethodDef __pyx_mdef_6gevent_8resolver_5cares_7channel_19_getnameinfo = {"_getnameinfo", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6gevent_8resolver_5cares_7channel_19_getnameinfo, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
    static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_19_getnameinfo(PyObject *__pyx_v_self,
    #if CYTHON_METH_FASTCALL
    PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
    #else
    PyObject *__pyx_args, PyObject *__pyx_kwds
    #endif
    ) {
      PyObject *__pyx_v_callback = 0;
      PyObject *__pyx_v_sockaddr = 0;
      int __pyx_v_flags;
      #if !CYTHON_METH_FASTCALL
      CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
      #endif
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("_getnameinfo (wrapper)", 0);
      {
        #if CYTHON_USE_MODULE_STATE
        PyObject **__pyx_pyargnames[] = {&__pyx_n_s_callback,&__pyx_n_s_sockaddr,&__pyx_n_s_flags,0};
        #else
        static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_callback,&__pyx_n_s_sockaddr,&__pyx_n_s_flags,0};
        #endif
        PyObject* values[3] = {0,0,0};
        if (__pyx_kwds) {
          Py_ssize_t kw_args;
          switch (__pyx_nargs) {
            case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
            CYTHON_FALLTHROUGH;
            case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
            CYTHON_FALLTHROUGH;
            case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
            CYTHON_FALLTHROUGH;
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
          switch (__pyx_nargs) {
            case  0:
            if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_callback)) != 0)) kw_args--;
            else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 568, __pyx_L3_error)
            else goto __pyx_L5_argtuple_error;
            CYTHON_FALLTHROUGH;
            case  1:
            if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sockaddr)) != 0)) kw_args--;
            else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 568, __pyx_L3_error)
            else {
              __Pyx_RaiseArgtupleInvalid("_getnameinfo", 1, 3, 3, 1); __PYX_ERR(0, 568, __pyx_L3_error)
            }
            CYTHON_FALLTHROUGH;
            case  2:
            if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_flags)) != 0)) kw_args--;
            else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 568, __pyx_L3_error)
            else {
              __Pyx_RaiseArgtupleInvalid("_getnameinfo", 1, 3, 3, 2); __PYX_ERR(0, 568, __pyx_L3_error)
            }
          }
          if (unlikely(kw_args > 0)) {
            const Py_ssize_t kwd_pos_args = __pyx_nargs;
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_getnameinfo") < 0)) __PYX_ERR(0, 568, __pyx_L3_error)
          }
        } else if (unlikely(__pyx_nargs != 3)) {
          goto __pyx_L5_argtuple_error;
        } else {
          values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
          values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
          values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        }
        __pyx_v_callback = values[0];
        __pyx_v_sockaddr = ((PyObject*)values[1]);
        __pyx_v_flags = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 568, __pyx_L3_error)
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("_getnameinfo", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 568, __pyx_L3_error)
      __pyx_L3_error:;
      __Pyx_AddTraceback("gevent.resolver.cares.channel._getnameinfo", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sockaddr), (&PyTuple_Type), 1, "sockaddr", 1))) __PYX_ERR(0, 568, __pyx_L1_error)
      __pyx_r = __pyx_pf_6gevent_8resolver_5cares_7channel_18_getnameinfo(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self), __pyx_v_callback, __pyx_v_sockaddr, __pyx_v_flags);
      int __pyx_lineno = 0;
      const char *__pyx_filename = NULL;
      int __pyx_clineno = 0;

      /* function exit code */
      goto __pyx_L0;
      __pyx_L1_error:;
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_6gevent_8resolver_5cares_7channel_18_getnameinfo(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_sockaddr, int __pyx_v_flags) {
      PyObject *__pyx_r = NULL;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("_getnameinfo", 0);
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = __pyx_f_6gevent_8resolver_5cares_7channel__getnameinfo(__pyx_v_self, __pyx_v_callback, __pyx_v_sockaddr, __pyx_v_flags, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 568, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;

      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_AddTraceback("gevent.resolver.cares.channel._getnameinfo", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }
    /* … */
      __pyx_tuple__29 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_callback, __pyx_n_s_sockaddr, __pyx_n_s_flags); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 568, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__29);
      __Pyx_GIVEREF(__pyx_tuple__29);
    /* … */
      __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6gevent_8resolver_5cares_7channel_19_getnameinfo, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_channel__getnameinfo, NULL, __pyx_n_s_gevent_resolver_cares, __pyx_d, ((PyObject *)__pyx_codeobj__30)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 568, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_8resolver_5cares_channel->tp_dict, __pyx_n_s_getnameinfo, __pyx_t_2) < 0) __PYX_ERR(0, 568, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      PyType_Modified(__pyx_ptype_6gevent_8resolver_5cares_channel);
      __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_resolver_cares_pyx, __pyx_n_s_getnameinfo, 568, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(0, 568, __pyx_L1_error)

    +569:         if not self.channel:

      __pyx_t_7 = ((!(__pyx_v_self->channel != 0)) != 0);
      if (unlikely(__pyx_t_7)) {
    /* … */
      }

    +570:             raise gaierror(cares.ARES_EDESTRUCTION, 'this ares channel has been destroyed')

        __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_gaierror); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 570, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_4 = __Pyx_PyInt_From_int(ARES_EDESTRUCTION); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 570, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_3 = NULL;
        __pyx_t_6 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
          if (likely(__pyx_t_3)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
            __Pyx_INCREF(__pyx_t_3);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_2, function);
            __pyx_t_6 = 1;
          }
        }
        {
          PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_t_4, __pyx_kp_s_this_ares_channel_has_been_destr};
          __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6);
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 570, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        }
        __Pyx_Raise(__pyx_t_1, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __PYX_ERR(0, 570, __pyx_L1_error)

    +571:         cdef char* hostp = NULL

      __pyx_v_hostp = NULL;

    +572:         cdef int port = 0

      __pyx_v_port = 0;

    +573:         cdef int flowinfo = 0

      __pyx_v_flowinfo = 0;

    +574:         cdef int scope_id = 0

      __pyx_v_scope_id = 0;

     575:         cdef sockaddr_in6 sa6

    +576:         if not PyTuple_Check(sockaddr):

      __pyx_t_7 = ((!(PyTuple_Check(__pyx_v_sockaddr) != 0)) != 0);
      if (unlikely(__pyx_t_7)) {
    /* … */
      }

    +577:             raise TypeError('expected a tuple, got %r' % (sockaddr, ))

        __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 577, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_INCREF(__pyx_v_sockaddr);
        __Pyx_GIVEREF(__pyx_v_sockaddr);
        PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_sockaddr);
        __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_expected_a_tuple_got_r, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 577, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 577, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_Raise(__pyx_t_1, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __PYX_ERR(0, 577, __pyx_L1_error)

    +578:         PyArg_ParseTuple(sockaddr, "si|ii", &hostp, &port, &flowinfo, &scope_id)

      __pyx_t_6 = PyArg_ParseTuple(__pyx_v_sockaddr, ((char *)"si|ii"), (&__pyx_v_hostp), (&__pyx_v_port), (&__pyx_v_flowinfo), (&__pyx_v_scope_id)); if (unlikely(__pyx_t_6 == ((int)0))) __PYX_ERR(0, 578, __pyx_L1_error)

     579:         # if port < 0 or port > 65535:

     580:         #     raise gaierror(-8, 'Invalid value for port: %r' % port)

    +581:         cdef int length = _make_sockaddr(hostp, port, flowinfo, scope_id, &sa6)

      __pyx_v_length = __pyx_f_6gevent_8resolver_5cares__make_sockaddr(__pyx_v_hostp, __pyx_v_port, __pyx_v_flowinfo, __pyx_v_scope_id, (&__pyx_v_sa6));

    +582:         if length <= 0:

      __pyx_t_7 = ((__pyx_v_length <= 0) != 0);
      if (unlikely(__pyx_t_7)) {
    /* … */
      }

    +583:             raise InvalidIP(repr(hostp))

        __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_InvalidIP); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 583, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_hostp); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 583, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_3 = PyObject_Repr(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 583, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = NULL;
        __pyx_t_6 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_2, function);
            __pyx_t_6 = 1;
          }
        }
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_3};
          __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 583, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        }
        __Pyx_Raise(__pyx_t_1, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __PYX_ERR(0, 583, __pyx_L1_error)

    +584:         cdef object arg = (self, callback)

      __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 584, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_INCREF((PyObject *)__pyx_v_self);
      __Pyx_GIVEREF((PyObject *)__pyx_v_self);
      PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self));
      __Pyx_INCREF(__pyx_v_callback);
      __Pyx_GIVEREF(__pyx_v_callback);
      PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_callback);
      __pyx_v_arg = __pyx_t_1;
      __pyx_t_1 = 0;

    +585:         Py_INCREF(arg)

      Py_INCREF(__pyx_v_arg);

    +586:         cdef sockaddr_t* x = <sockaddr_t*>&sa6

      __pyx_v_x = ((struct sockaddr *)(&__pyx_v_sa6));

    +587:         cares.ares_getnameinfo(self.channel, x, length, flags, <void*>gevent_ares_nameinfo_callback, <void*>arg)

      ares_getnameinfo(__pyx_v_self->channel, __pyx_v_x, __pyx_v_length, __pyx_v_flags, ((void *)__pyx_f_6gevent_8resolver_5cares_gevent_ares_nameinfo_callback), ((void *)__pyx_v_arg));

     588:

     589:     @staticmethod

    +590:     cdef int _convert_cares_ni_flags(int flags):

    static int __pyx_f_6gevent_8resolver_5cares_7channel__convert_cares_ni_flags(int __pyx_v_flags) {
      int __pyx_v_cares_flags;
      int __pyx_r;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("_convert_cares_ni_flags", 0);
    /* … */
      /* function exit code */
      __pyx_L0:;
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    +591:         cdef int cares_flags = cares.ARES_NI_LOOKUPHOST | cares.ARES_NI_LOOKUPSERVICE

      __pyx_v_cares_flags = (ARES_NI_LOOKUPHOST | ARES_NI_LOOKUPSERVICE);

    +592:         if flags & NI_NUMERICHOST:

      __pyx_t_1 = ((__pyx_v_flags & __pyx_v_6gevent_8resolver_5cares_NI_NUMERICHOST) != 0);
      if (__pyx_t_1) {
    /* … */
      }

    +593:             cares_flags |= cares.ARES_NI_NUMERICHOST

        __pyx_v_cares_flags = (__pyx_v_cares_flags | ARES_NI_NUMERICHOST);

    +594:         if flags & NI_NUMERICSERV:

      __pyx_t_1 = ((__pyx_v_flags & __pyx_v_6gevent_8resolver_5cares_NI_NUMERICSERV) != 0);
      if (__pyx_t_1) {
    /* … */
      }

    +595:             cares_flags |= cares.ARES_NI_NUMERICSERV

        __pyx_v_cares_flags = (__pyx_v_cares_flags | ARES_NI_NUMERICSERV);

    +596:         if flags & NI_NOFQDN:

      __pyx_t_1 = ((__pyx_v_flags & __pyx_v_6gevent_8resolver_5cares_NI_NOFQDN) != 0);
      if (__pyx_t_1) {
    /* … */
      }

    +597:             cares_flags |= cares.ARES_NI_NOFQDN

        __pyx_v_cares_flags = (__pyx_v_cares_flags | ARES_NI_NOFQDN);

    +598:         if flags & NI_NAMEREQD:

      __pyx_t_1 = ((__pyx_v_flags & __pyx_v_6gevent_8resolver_5cares_NI_NAMEREQD) != 0);
      if (__pyx_t_1) {
    /* … */
      }

    +599:             cares_flags |= cares.ARES_NI_NAMEREQD

        __pyx_v_cares_flags = (__pyx_v_cares_flags | ARES_NI_NAMEREQD);

    +600:         if flags & NI_DGRAM:

      __pyx_t_1 = ((__pyx_v_flags & __pyx_v_6gevent_8resolver_5cares_NI_DGRAM) != 0);
      if (__pyx_t_1) {
    /* … */
      }

    +601:             cares_flags |= cares.ARES_NI_DGRAM

        __pyx_v_cares_flags = (__pyx_v_cares_flags | ARES_NI_DGRAM);

    +602:         return cares_flags

      __pyx_r = __pyx_v_cares_flags;
      goto __pyx_L0;

     603:

    +604:     def getnameinfo(self, object callback, tuple sockaddr, int flags):

    /* Python wrapper */
    static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_21getnameinfo(PyObject *__pyx_v_self,
    #if CYTHON_METH_FASTCALL
    PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
    #else
    PyObject *__pyx_args, PyObject *__pyx_kwds
    #endif
    ); /*proto*/
    static PyMethodDef __pyx_mdef_6gevent_8resolver_5cares_7channel_21getnameinfo = {"getnameinfo", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6gevent_8resolver_5cares_7channel_21getnameinfo, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
    static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_21getnameinfo(PyObject *__pyx_v_self,
    #if CYTHON_METH_FASTCALL
    PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
    #else
    PyObject *__pyx_args, PyObject *__pyx_kwds
    #endif
    ) {
      PyObject *__pyx_v_callback = 0;
      PyObject *__pyx_v_sockaddr = 0;
      int __pyx_v_flags;
      #if !CYTHON_METH_FASTCALL
      CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
      #endif
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("getnameinfo (wrapper)", 0);
      {
        #if CYTHON_USE_MODULE_STATE
        PyObject **__pyx_pyargnames[] = {&__pyx_n_s_callback,&__pyx_n_s_sockaddr,&__pyx_n_s_flags,0};
        #else
        static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_callback,&__pyx_n_s_sockaddr,&__pyx_n_s_flags,0};
        #endif
        PyObject* values[3] = {0,0,0};
        if (__pyx_kwds) {
          Py_ssize_t kw_args;
          switch (__pyx_nargs) {
            case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
            CYTHON_FALLTHROUGH;
            case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
            CYTHON_FALLTHROUGH;
            case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
            CYTHON_FALLTHROUGH;
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
          switch (__pyx_nargs) {
            case  0:
            if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_callback)) != 0)) kw_args--;
            else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 604, __pyx_L3_error)
            else goto __pyx_L5_argtuple_error;
            CYTHON_FALLTHROUGH;
            case  1:
            if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sockaddr)) != 0)) kw_args--;
            else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 604, __pyx_L3_error)
            else {
              __Pyx_RaiseArgtupleInvalid("getnameinfo", 1, 3, 3, 1); __PYX_ERR(0, 604, __pyx_L3_error)
            }
            CYTHON_FALLTHROUGH;
            case  2:
            if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_flags)) != 0)) kw_args--;
            else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 604, __pyx_L3_error)
            else {
              __Pyx_RaiseArgtupleInvalid("getnameinfo", 1, 3, 3, 2); __PYX_ERR(0, 604, __pyx_L3_error)
            }
          }
          if (unlikely(kw_args > 0)) {
            const Py_ssize_t kwd_pos_args = __pyx_nargs;
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getnameinfo") < 0)) __PYX_ERR(0, 604, __pyx_L3_error)
          }
        } else if (unlikely(__pyx_nargs != 3)) {
          goto __pyx_L5_argtuple_error;
        } else {
          values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
          values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
          values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        }
        __pyx_v_callback = values[0];
        __pyx_v_sockaddr = ((PyObject*)values[1]);
        __pyx_v_flags = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 604, __pyx_L3_error)
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("getnameinfo", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 604, __pyx_L3_error)
      __pyx_L3_error:;
      __Pyx_AddTraceback("gevent.resolver.cares.channel.getnameinfo", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sockaddr), (&PyTuple_Type), 1, "sockaddr", 1))) __PYX_ERR(0, 604, __pyx_L1_error)
      __pyx_r = __pyx_pf_6gevent_8resolver_5cares_7channel_20getnameinfo(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self), __pyx_v_callback, __pyx_v_sockaddr, __pyx_v_flags);
      int __pyx_lineno = 0;
      const char *__pyx_filename = NULL;
      int __pyx_clineno = 0;

      /* function exit code */
      goto __pyx_L0;
      __pyx_L1_error:;
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_6gevent_8resolver_5cares_7channel_20getnameinfo(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_sockaddr, int __pyx_v_flags) {
      PyObject *__pyx_r = NULL;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("getnameinfo", 0);
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_AddTraceback("gevent.resolver.cares.channel.getnameinfo", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }
    /* … */
      __pyx_tuple__31 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_callback, __pyx_n_s_sockaddr, __pyx_n_s_flags); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 604, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__31);
      __Pyx_GIVEREF(__pyx_tuple__31);
    /* … */
      __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6gevent_8resolver_5cares_7channel_21getnameinfo, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_channel_getnameinfo, NULL, __pyx_n_s_gevent_resolver_cares, __pyx_d, ((PyObject *)__pyx_codeobj__32)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 604, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_8resolver_5cares_channel->tp_dict, __pyx_n_s_getnameinfo_2, __pyx_t_2) < 0) __PYX_ERR(0, 604, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      PyType_Modified(__pyx_ptype_6gevent_8resolver_5cares_channel);
      __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_resolver_cares_pyx, __pyx_n_s_getnameinfo_2, 604, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(0, 604, __pyx_L1_error)

    +605:         flags = channel._convert_cares_ni_flags(flags)

      __pyx_v_flags = __pyx_f_6gevent_8resolver_5cares_7channel__convert_cares_ni_flags(__pyx_v_flags);

    +606:         return self._getnameinfo(callback, sockaddr, flags)

      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_8resolver_5cares_channel *)__pyx_v_self->__pyx_vtab)->_getnameinfo(__pyx_v_self, __pyx_v_callback, __pyx_v_sockaddr, __pyx_v_flags, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 606, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;

     607:

     608:     @staticmethod

    +609:     cdef int _convert_cares_ai_flags(int flags):

    static int __pyx_f_6gevent_8resolver_5cares_7channel__convert_cares_ai_flags(int __pyx_v_flags) {
      int __pyx_v_cares_flags;
      int __pyx_r;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("_convert_cares_ai_flags", 0);
    /* … */
      /* function exit code */
      __pyx_L0:;
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

     610:         # c-ares supports a limited set of flags.

     611:         # We always want NOSORT, because that implies that

     612:         # c-ares will not connect to resolved addresses.

    +613:         cdef int cares_flags = cares.ARES_AI_NOSORT

      __pyx_v_cares_flags = ARES_AI_NOSORT;

    +614:         if flags & AI_CANONNAME:

      __pyx_t_1 = ((__pyx_v_flags & __pyx_v_6gevent_8resolver_5cares_AI_CANONNAME) != 0);
      if (__pyx_t_1) {
    /* … */
      }

    +615:             cares_flags |= cares.ARES_AI_CANONNAME

        __pyx_v_cares_flags = (__pyx_v_cares_flags | ARES_AI_CANONNAME);

    +616:         if flags & AI_NUMERICSERV:

      __pyx_t_1 = ((__pyx_v_flags & __pyx_v_6gevent_8resolver_5cares_AI_NUMERICSERV) != 0);
      if (__pyx_t_1) {
    /* … */
      }

    +617:             cares_flags |= cares.ARES_AI_NUMERICSERV

        __pyx_v_cares_flags = (__pyx_v_cares_flags | ARES_AI_NUMERICSERV);

    +618:         return cares_flags

      __pyx_r = __pyx_v_cares_flags;
      goto __pyx_L0;

     619:

     620:     @staticmethod

    +621:     cdef void _getaddrinfo_cb(void *arg,

    static void __pyx_f_6gevent_8resolver_5cares_7channel__getaddrinfo_cb(void *__pyx_v_arg, int __pyx_v_status, CYTHON_UNUSED int __pyx_v_timeouts, struct ares_addrinfo *__pyx_v_result) {
      struct ares_addrinfo_node *__pyx_v_nodes;
      struct ares_addrinfo_cname *__pyx_v_cnames;
      struct sockaddr_in *__pyx_v_sadr4;
      struct sockaddr_in6 *__pyx_v_sadr6;
      PyObject *__pyx_v_canonname = 0;
      struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_channel = 0;
      PyObject *__pyx_v_callback = 0;
      char __pyx_v_tmpbuf[46];
      PyObject *__pyx_v_addrs = NULL;
      PyObject *__pyx_v_sockaddr = NULL;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("_getaddrinfo_cb", 0);
    /* … */
      /* function exit code */
      goto __pyx_L0;
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_8);
      __Pyx_XDECREF(__pyx_t_12);
      __Pyx_XDECREF(__pyx_t_14);
      __Pyx_XDECREF(__pyx_t_15);
      __Pyx_XDECREF(__pyx_t_16);
      __Pyx_WriteUnraisable("gevent.resolver.cares.channel._getaddrinfo_cb", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
      __pyx_L0:;
      __Pyx_XDECREF(__pyx_v_canonname);
      __Pyx_XDECREF((PyObject *)__pyx_v_channel);
      __Pyx_XDECREF(__pyx_v_callback);
      __Pyx_XDECREF(__pyx_v_addrs);
      __Pyx_XDECREF(__pyx_v_sockaddr);
      __Pyx_RefNannyFinishContext();
    }

     622:                               int status,

     623:                               int timeouts,

     624:                               cares.ares_addrinfo* result):

     625:         cdef cares.ares_addrinfo_node* nodes

     626:         cdef cares.ares_addrinfo_cname* cnames

     627:         cdef sockaddr_in* sadr4

     628:         cdef sockaddr_in6* sadr6

    +629:         cdef object canonname = ''

      __Pyx_INCREF(__pyx_kp_s__4);
      __pyx_v_canonname = __pyx_kp_s__4;

     630:

     631:         cdef channel channel

     632:         cdef object callback

     633:         # INET6_ADDRSTRLEN is 46, but we can't use that named constant

     634:         # here; cython doesn't like it.

     635:         cdef char tmpbuf[46]

     636:

    +637:         channel, callback = <tuple>arg

      __pyx_t_1 = ((PyObject *)__pyx_v_arg);
      __Pyx_INCREF(__pyx_t_1);
      if (likely(__pyx_t_1 != Py_None)) {
        PyObject* sequence = __pyx_t_1;
        Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
        if (unlikely(size != 2)) {
          if (size > 2) __Pyx_RaiseTooManyValuesError(2);
          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
          __PYX_ERR(0, 637, __pyx_L1_error)
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
        __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        #else
        __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 637, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 637, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      } else {
        __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(0, 637, __pyx_L1_error)
      }
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_6gevent_8resolver_5cares_channel))))) __PYX_ERR(0, 637, __pyx_L1_error)
      __pyx_v_channel = ((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_v_callback = __pyx_t_3;
      __pyx_t_3 = 0;

    +638:         Py_DECREF(<tuple>arg)

      Py_DECREF(((PyObject *)__pyx_v_arg));

     639:

     640:

     641:         # Result is a list of:

     642:         # (family, socktype, proto, canonname, sockaddr)

     643:         # Where sockaddr depends on family; for INET it is

     644:         # (address, port)

     645:         # and INET6 is

     646:         # (address, port, flow info, scope id)

     647:         # TODO: Check the canonnames.

    +648:         addrs = []

      __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 648, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_v_addrs = ((PyObject*)__pyx_t_1);
      __pyx_t_1 = 0;

    +649:         try:

      /*try:*/ {
        {
          /*try:*/ {
    /* … */
          }
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          goto __pyx_L11_try_end;
          __pyx_L6_error:;
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    /* … */
          __Pyx_XGIVEREF(__pyx_t_4);
          __Pyx_XGIVEREF(__pyx_t_5);
          __Pyx_XGIVEREF(__pyx_t_6);
          __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
          goto __pyx_L4_error;
          __pyx_L10_try_return:;
          __Pyx_XGIVEREF(__pyx_t_4);
          __Pyx_XGIVEREF(__pyx_t_5);
          __Pyx_XGIVEREF(__pyx_t_6);
          __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
          goto __pyx_L3_return;
          __pyx_L7_exception_handled:;
          __Pyx_XGIVEREF(__pyx_t_4);
          __Pyx_XGIVEREF(__pyx_t_5);
          __Pyx_XGIVEREF(__pyx_t_6);
          __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
          __pyx_L11_try_end:;
        }
      }

    +650:             if status != cares.ARES_SUCCESS:

            __pyx_t_7 = ((__pyx_v_status != ARES_SUCCESS) != 0);
            if (__pyx_t_7) {
    /* … */
            }

    +651:                 callback(Result(None, _gevent_gaierror_from_status(status)))

              __pyx_t_3 = __pyx_f_6gevent_8resolver_5cares__gevent_gaierror_from_status(__pyx_v_status); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 651, __pyx_L6_error)
              __Pyx_GOTREF(__pyx_t_3);
              __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 651, __pyx_L6_error)
              __Pyx_GOTREF(__pyx_t_2);
              __Pyx_INCREF(Py_None);
              __Pyx_GIVEREF(Py_None);
              PyTuple_SET_ITEM(__pyx_t_2, 0, Py_None);
              __Pyx_GIVEREF(__pyx_t_3);
              PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
              __pyx_t_3 = 0;
              __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_8resolver_5cares_Result), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 651, __pyx_L6_error)
              __Pyx_GOTREF(__pyx_t_3);
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
              __Pyx_INCREF(__pyx_v_callback);
              __pyx_t_2 = __pyx_v_callback; __pyx_t_8 = NULL;
              __pyx_t_9 = 0;
              if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
                __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
                if (likely(__pyx_t_8)) {
                  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
                  __Pyx_INCREF(__pyx_t_8);
                  __Pyx_INCREF(function);
                  __Pyx_DECREF_SET(__pyx_t_2, function);
                  __pyx_t_9 = 1;
                }
              }
              {
                PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_3};
                __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9);
                __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
                __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
                if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 651, __pyx_L6_error)
                __Pyx_GOTREF(__pyx_t_1);
                __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
              }
              __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    +652:                 return

              goto __pyx_L10_try_return;

    +653:             if result.cnames:

            __pyx_t_7 = (__pyx_v_result->cnames != 0);
            if (__pyx_t_7) {
    /* … */
            }

     654:                 # These tend to come in pairs:

     655:                 #

     656:                 # alias: www.gevent.org name: python-gevent.readthedocs.org

     657:                 # alias: python-gevent.readthedocs.org name: readthedocs.io

     658:                 #

     659:                 # The standard library returns the last name so we do too.

     660:

    +661:                 cnames = result.cnames

              __pyx_t_10 = __pyx_v_result->cnames;
              __pyx_v_cnames = __pyx_t_10;

    +662:                 while cnames:

              while (1) {
                __pyx_t_7 = (__pyx_v_cnames != 0);
                if (!__pyx_t_7) break;

    +663:                     canonname = _as_str(cnames.name)

                __pyx_t_1 = __pyx_f_6gevent_8resolver_5cares__as_str(__pyx_v_cnames->name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 663, __pyx_L6_error)
                __Pyx_GOTREF(__pyx_t_1);
                __Pyx_DECREF_SET(__pyx_v_canonname, __pyx_t_1);
                __pyx_t_1 = 0;

    +664:                     cnames = cnames.next

                __pyx_t_10 = __pyx_v_cnames->next;
                __pyx_v_cnames = __pyx_t_10;
              }

     665:

    +666:             nodes = result.nodes

            __pyx_t_11 = __pyx_v_result->nodes;
            __pyx_v_nodes = __pyx_t_11;

    +667:             while nodes:

            while (1) {
              __pyx_t_7 = (__pyx_v_nodes != 0);
              if (!__pyx_t_7) break;

    +668:                 if nodes.ai_family == AF_INET:

              __pyx_t_7 = ((__pyx_v_nodes->ai_family == AF_INET) != 0);
              if (__pyx_t_7) {
    /* … */
                goto __pyx_L18;
              }

    +669:                     sadr4 = <sockaddr_in*>nodes.ai_addr

                __pyx_v_sadr4 = ((struct sockaddr_in *)__pyx_v_nodes->ai_addr);

    +670:                     cares.ares_inet_ntop(nodes.ai_family, &sadr4.sin_addr, tmpbuf,

                (void)(ares_inet_ntop(__pyx_v_nodes->ai_family, (&__pyx_v_sadr4->sin_addr), __pyx_v_tmpbuf, INET6_ADDRSTRLEN));

     671:                                             INET6_ADDRSTRLEN)

     672:                     sockaddr = (

    +673:                         _as_str(tmpbuf),

                __pyx_t_1 = __pyx_f_6gevent_8resolver_5cares__as_str(__pyx_v_tmpbuf); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 673, __pyx_L6_error)
                __Pyx_GOTREF(__pyx_t_1);
    /* … */
                __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 673, __pyx_L6_error)
                __Pyx_GOTREF(__pyx_t_3);
                __Pyx_GIVEREF(__pyx_t_1);
                PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
                __Pyx_GIVEREF(__pyx_t_2);
                PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
                __pyx_t_1 = 0;
                __pyx_t_2 = 0;
                __Pyx_XDECREF_SET(__pyx_v_sockaddr, ((PyObject*)__pyx_t_3));
                __pyx_t_3 = 0;

    +674:                         ntohs(sadr4.sin_port),

                __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(ntohs(__pyx_v_sadr4->sin_port)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 674, __pyx_L6_error)
                __Pyx_GOTREF(__pyx_t_2);

     675:                     )

    +676:                 elif nodes.ai_family == AF_INET6:

              __pyx_t_7 = ((__pyx_v_nodes->ai_family == AF_INET6) != 0);
              if (__pyx_t_7) {
    /* … */
              }
              __pyx_L18:;

    +677:                     sadr6 = <sockaddr_in6*>nodes.ai_addr

                __pyx_v_sadr6 = ((struct sockaddr_in6 *)__pyx_v_nodes->ai_addr);

    +678:                     cares.ares_inet_ntop(nodes.ai_family, &sadr6.sin6_addr, tmpbuf,

                (void)(ares_inet_ntop(__pyx_v_nodes->ai_family, (&__pyx_v_sadr6->sin6_addr), __pyx_v_tmpbuf, INET6_ADDRSTRLEN));

     679:                                             INET6_ADDRSTRLEN)

     680:

     681:                     sockaddr = (

    +682:                         _as_str(tmpbuf),

                __pyx_t_3 = __pyx_f_6gevent_8resolver_5cares__as_str(__pyx_v_tmpbuf); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 682, __pyx_L6_error)
                __Pyx_GOTREF(__pyx_t_3);
    /* … */
                __pyx_t_12 = PyTuple_New(4); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 682, __pyx_L6_error)
                __Pyx_GOTREF(__pyx_t_12);
                __Pyx_GIVEREF(__pyx_t_3);
                PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_3);
                __Pyx_GIVEREF(__pyx_t_2);
                PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_2);
                __Pyx_GIVEREF(__pyx_t_1);
                PyTuple_SET_ITEM(__pyx_t_12, 2, __pyx_t_1);
                __Pyx_GIVEREF(__pyx_t_8);
                PyTuple_SET_ITEM(__pyx_t_12, 3, __pyx_t_8);
                __pyx_t_3 = 0;
                __pyx_t_2 = 0;
                __pyx_t_1 = 0;
                __pyx_t_8 = 0;
                __Pyx_XDECREF_SET(__pyx_v_sockaddr, ((PyObject*)__pyx_t_12));
                __pyx_t_12 = 0;

    +683:                         ntohs(sadr6.sin6_port),

                __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(ntohs(__pyx_v_sadr6->sin6_port)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 683, __pyx_L6_error)
                __Pyx_GOTREF(__pyx_t_2);

    +684:                         sadr6.sin6_flowinfo,

                __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(__pyx_v_sadr6->sin6_flowinfo); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 684, __pyx_L6_error)
                __Pyx_GOTREF(__pyx_t_1);

    +685:                         sadr6.sin6_scope_id,

                __pyx_t_8 = __Pyx_PyInt_From_unsigned_int(__pyx_v_sadr6->sin6_scope_id); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 685, __pyx_L6_error)
                __Pyx_GOTREF(__pyx_t_8);

     686:                     )

    +687:                 addrs.append((

              __pyx_t_13 = __Pyx_PyList_Append(__pyx_v_addrs, __pyx_t_2); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(0, 687, __pyx_L6_error)
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    +688:                     nodes.ai_family,

              __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_v_nodes->ai_family); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 688, __pyx_L6_error)
              __Pyx_GOTREF(__pyx_t_12);
    /* … */
              __pyx_t_2 = PyTuple_New(5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 688, __pyx_L6_error)
              __Pyx_GOTREF(__pyx_t_2);
              __Pyx_GIVEREF(__pyx_t_12);
              PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_12);
              __Pyx_GIVEREF(__pyx_t_8);
              PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_8);
              __Pyx_GIVEREF(__pyx_t_1);
              PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_1);
              __Pyx_INCREF(__pyx_v_canonname);
              __Pyx_GIVEREF(__pyx_v_canonname);
              PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_canonname);
              __Pyx_INCREF(__pyx_v_sockaddr);
              __Pyx_GIVEREF(__pyx_v_sockaddr);
              PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_v_sockaddr);
              __pyx_t_12 = 0;
              __pyx_t_8 = 0;
              __pyx_t_1 = 0;

    +689:                     nodes.ai_socktype,

              __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_nodes->ai_socktype); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 689, __pyx_L6_error)
              __Pyx_GOTREF(__pyx_t_8);

    +690:                     nodes.ai_protocol,

              __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_nodes->ai_protocol); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 690, __pyx_L6_error)
              __Pyx_GOTREF(__pyx_t_1);

     691:                     canonname,

    +692:                     sockaddr,

              if (unlikely(!__pyx_v_sockaddr)) { __Pyx_RaiseUnboundLocalError("sockaddr"); __PYX_ERR(0, 692, __pyx_L6_error) }

     693:                 ))

    +694:                 nodes = nodes.ai_next

              __pyx_t_11 = __pyx_v_nodes->ai_next;
              __pyx_v_nodes = __pyx_t_11;
            }

     695:

    +696:             callback(Result(addrs, None))

            __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 696, __pyx_L6_error)
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_INCREF(__pyx_v_addrs);
            __Pyx_GIVEREF(__pyx_v_addrs);
            PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_addrs);
            __Pyx_INCREF(Py_None);
            __Pyx_GIVEREF(Py_None);
            PyTuple_SET_ITEM(__pyx_t_1, 1, Py_None);
            __pyx_t_8 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_8resolver_5cares_Result), __pyx_t_1, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 696, __pyx_L6_error)
            __Pyx_GOTREF(__pyx_t_8);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __Pyx_INCREF(__pyx_v_callback);
            __pyx_t_1 = __pyx_v_callback; __pyx_t_12 = NULL;
            __pyx_t_9 = 0;
            if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
              __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_1);
              if (likely(__pyx_t_12)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
                __Pyx_INCREF(__pyx_t_12);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_1, function);
                __pyx_t_9 = 1;
              }
            }
            {
              PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_t_8};
              __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9);
              __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 696, __pyx_L6_error)
              __Pyx_GOTREF(__pyx_t_2);
              __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            }
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    +697:         except:

          /*except:*/ {
            __Pyx_AddTraceback("gevent.resolver.cares.channel._getaddrinfo_cb", __pyx_clineno, __pyx_lineno, __pyx_filename);
            if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_1, &__pyx_t_8) < 0) __PYX_ERR(0, 697, __pyx_L8_except_error)
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_GOTREF(__pyx_t_8);

    +698:             channel.loop.handle_error(callback, *sys.exc_info())

            __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_channel->loop, __pyx_n_s_handle_error); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 698, __pyx_L8_except_error)
            __Pyx_GOTREF(__pyx_t_12);
            __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 698, __pyx_L8_except_error)
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_INCREF(__pyx_v_callback);
            __Pyx_GIVEREF(__pyx_v_callback);
            PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_callback);
            __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_sys); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 698, __pyx_L8_except_error)
            __Pyx_GOTREF(__pyx_t_15);
            __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_exc_info); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 698, __pyx_L8_except_error)
            __Pyx_GOTREF(__pyx_t_16);
            __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
            __pyx_t_15 = NULL;
            __pyx_t_9 = 0;
            if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_16))) {
              __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_16);
              if (likely(__pyx_t_15)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_16);
                __Pyx_INCREF(__pyx_t_15);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_16, function);
                __pyx_t_9 = 1;
              }
            }
            {
              PyObject *__pyx_callargs[1] = {__pyx_t_15, };
              __pyx_t_14 = __Pyx_PyObject_FastCall(__pyx_t_16, __pyx_callargs+1-__pyx_t_9, 0+__pyx_t_9);
              __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
              if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 698, __pyx_L8_except_error)
              __Pyx_GOTREF(__pyx_t_14);
              __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
            }
            __pyx_t_16 = __Pyx_PySequence_Tuple(__pyx_t_14); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 698, __pyx_L8_except_error)
            __Pyx_GOTREF(__pyx_t_16);
            __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
            __pyx_t_14 = PyNumber_Add(__pyx_t_3, __pyx_t_16); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 698, __pyx_L8_except_error)
            __Pyx_GOTREF(__pyx_t_14);
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
            __pyx_t_16 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_14, NULL); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 698, __pyx_L8_except_error)
            __Pyx_GOTREF(__pyx_t_16);
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
            __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
            __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
            __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
            __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
            goto __pyx_L7_exception_handled;
          }
          __pyx_L8_except_error:;

     699:         finally:

    +700:             if result:

      /*finally:*/ {
        /*normal exit:*/{
          __pyx_t_7 = (__pyx_v_result != 0);
          if (__pyx_t_7) {
    /* … */
          }
          goto __pyx_L5;
        }
        __pyx_L4_error:;
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __pyx_t_6 = 0; __pyx_t_5 = 0; __pyx_t_4 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0;
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
          __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
          __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4) < 0)) __Pyx_ErrFetch(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4);
          __Pyx_XGOTREF(__pyx_t_6);
          __Pyx_XGOTREF(__pyx_t_5);
          __Pyx_XGOTREF(__pyx_t_4);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __pyx_t_9 = __pyx_lineno; __pyx_t_17 = __pyx_clineno; __pyx_t_18 = __pyx_filename;
          {
            __pyx_t_7 = (__pyx_v_result != 0);
            if (__pyx_t_7) {
    /* … */
            }
          }
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_20, __pyx_t_21);
          }
          __Pyx_XGIVEREF(__pyx_t_6);
          __Pyx_XGIVEREF(__pyx_t_5);
          __Pyx_XGIVEREF(__pyx_t_4);
          __Pyx_ErrRestore(__pyx_t_6, __pyx_t_5, __pyx_t_4);
          __pyx_t_6 = 0; __pyx_t_5 = 0; __pyx_t_4 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0;
          __pyx_lineno = __pyx_t_9; __pyx_clineno = __pyx_t_17; __pyx_filename = __pyx_t_18;
          goto __pyx_L1_error;
        }
        __pyx_L3_return: {
          __pyx_t_7 = (__pyx_v_result != 0);
          if (__pyx_t_7) {
    /* … */
          }
          goto __pyx_L0;
        }
        __pyx_L5:;
      }

    +701:                 cares.ares_freeaddrinfo(result)

            ares_freeaddrinfo(__pyx_v_result);
    /* … */
              ares_freeaddrinfo(__pyx_v_result);
    /* … */
            ares_freeaddrinfo(__pyx_v_result);

     702:

    +703:     def getaddrinfo(self,

    /* Python wrapper */
    static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_23getaddrinfo(PyObject *__pyx_v_self,
    #if CYTHON_METH_FASTCALL
    PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
    #else
    PyObject *__pyx_args, PyObject *__pyx_kwds
    #endif
    ); /*proto*/
    static PyMethodDef __pyx_mdef_6gevent_8resolver_5cares_7channel_23getaddrinfo = {"getaddrinfo", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6gevent_8resolver_5cares_7channel_23getaddrinfo, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
    static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_23getaddrinfo(PyObject *__pyx_v_self,
    #if CYTHON_METH_FASTCALL
    PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
    #else
    PyObject *__pyx_args, PyObject *__pyx_kwds
    #endif
    ) {
      PyObject *__pyx_v_callback = 0;
      char const *__pyx_v_name;
      PyObject *__pyx_v_service = 0;
      int __pyx_v_family;
      int __pyx_v_type;
      int __pyx_v_proto;
      int __pyx_v_flags;
      #if !CYTHON_METH_FASTCALL
      CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
      #endif
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("getaddrinfo (wrapper)", 0);
      {
        #if CYTHON_USE_MODULE_STATE
        PyObject **__pyx_pyargnames[] = {&__pyx_n_s_callback,&__pyx_n_s_name_2,&__pyx_n_s_service,&__pyx_n_s_family,&__pyx_n_s_type,&__pyx_n_s_proto,&__pyx_n_s_flags,0};
        #else
        static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_callback,&__pyx_n_s_name_2,&__pyx_n_s_service,&__pyx_n_s_family,&__pyx_n_s_type,&__pyx_n_s_proto,&__pyx_n_s_flags,0};
        #endif
        PyObject* values[7] = {0,0,0,0,0,0,0};
        if (__pyx_kwds) {
          Py_ssize_t kw_args;
          switch (__pyx_nargs) {
            case  7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6);
            CYTHON_FALLTHROUGH;
            case  6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5);
            CYTHON_FALLTHROUGH;
            case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
            CYTHON_FALLTHROUGH;
            case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
            CYTHON_FALLTHROUGH;
            case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
            CYTHON_FALLTHROUGH;
            case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
            CYTHON_FALLTHROUGH;
            case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
            CYTHON_FALLTHROUGH;
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
          switch (__pyx_nargs) {
            case  0:
            if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_callback)) != 0)) kw_args--;
            else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 703, __pyx_L3_error)
            else goto __pyx_L5_argtuple_error;
            CYTHON_FALLTHROUGH;
            case  1:
            if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name_2)) != 0)) kw_args--;
            else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 703, __pyx_L3_error)
            else {
              __Pyx_RaiseArgtupleInvalid("getaddrinfo", 0, 3, 7, 1); __PYX_ERR(0, 703, __pyx_L3_error)
            }
            CYTHON_FALLTHROUGH;
            case  2:
            if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_service)) != 0)) kw_args--;
            else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 703, __pyx_L3_error)
            else {
              __Pyx_RaiseArgtupleInvalid("getaddrinfo", 0, 3, 7, 2); __PYX_ERR(0, 703, __pyx_L3_error)
            }
            CYTHON_FALLTHROUGH;
            case  3:
            if (kw_args > 0) {
              PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_family);
              if (value) { values[3] = value; kw_args--; }
              else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 703, __pyx_L3_error)
            }
            CYTHON_FALLTHROUGH;
            case  4:
            if (kw_args > 0) {
              PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_type);
              if (value) { values[4] = value; kw_args--; }
              else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 703, __pyx_L3_error)
            }
            CYTHON_FALLTHROUGH;
            case  5:
            if (kw_args > 0) {
              PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_proto);
              if (value) { values[5] = value; kw_args--; }
              else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 703, __pyx_L3_error)
            }
            CYTHON_FALLTHROUGH;
            case  6:
            if (kw_args > 0) {
              PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_flags);
              if (value) { values[6] = value; kw_args--; }
              else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 703, __pyx_L3_error)
            }
          }
          if (unlikely(kw_args > 0)) {
            const Py_ssize_t kwd_pos_args = __pyx_nargs;
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getaddrinfo") < 0)) __PYX_ERR(0, 703, __pyx_L3_error)
          }
        } else {
          switch (__pyx_nargs) {
            case  7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6);
            CYTHON_FALLTHROUGH;
            case  6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5);
            CYTHON_FALLTHROUGH;
            case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
            CYTHON_FALLTHROUGH;
            case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
            CYTHON_FALLTHROUGH;
            case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
            values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
            values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
            break;
            default: goto __pyx_L5_argtuple_error;
          }
        }
        __pyx_v_callback = values[0];
        __pyx_v_name = __Pyx_PyObject_AsString(values[1]); if (unlikely((!__pyx_v_name) && PyErr_Occurred())) __PYX_ERR(0, 705, __pyx_L3_error)
        __pyx_v_service = values[2];
        if (values[3]) {
          __pyx_v_family = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_family == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 707, __pyx_L3_error)
        } else {
          __pyx_v_family = ((int)0);
        }
        if (values[4]) {
          __pyx_v_type = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_type == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 708, __pyx_L3_error)
        } else {
          __pyx_v_type = ((int)0);
        }
        if (values[5]) {
          __pyx_v_proto = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_proto == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 709, __pyx_L3_error)
        } else {
          __pyx_v_proto = ((int)0);
        }
        if (values[6]) {
          __pyx_v_flags = __Pyx_PyInt_As_int(values[6]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 710, __pyx_L3_error)
        } else {
          __pyx_v_flags = ((int)0);
        }
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("getaddrinfo", 0, 3, 7, __pyx_nargs); __PYX_ERR(0, 703, __pyx_L3_error)
      __pyx_L3_error:;
      __Pyx_AddTraceback("gevent.resolver.cares.channel.getaddrinfo", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_6gevent_8resolver_5cares_7channel_22getaddrinfo(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self), __pyx_v_callback, __pyx_v_name, __pyx_v_service, __pyx_v_family, __pyx_v_type, __pyx_v_proto, __pyx_v_flags);
      int __pyx_lineno = 0;
      const char *__pyx_filename = NULL;
      int __pyx_clineno = 0;

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_6gevent_8resolver_5cares_7channel_22getaddrinfo(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self, PyObject *__pyx_v_callback, char const *__pyx_v_name, PyObject *__pyx_v_service, int __pyx_v_family, int __pyx_v_type, int __pyx_v_proto, int __pyx_v_flags) {
      struct ares_addrinfo_hints __pyx_v_hints;
      PyObject *__pyx_v_arg = 0;
      PyObject *__pyx_r = NULL;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("getaddrinfo", 0);
    /* … */
      /* function exit code */
      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      goto __pyx_L0;
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_5);
      __Pyx_AddTraceback("gevent.resolver.cares.channel.getaddrinfo", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XDECREF(__pyx_v_arg);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }
    /* … */
      __pyx_tuple__33 = PyTuple_Pack(10, __pyx_n_s_self, __pyx_n_s_callback, __pyx_n_s_name_2, __pyx_n_s_service, __pyx_n_s_family, __pyx_n_s_type, __pyx_n_s_proto, __pyx_n_s_flags, __pyx_n_s_hints, __pyx_n_s_arg); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 703, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__33);
      __Pyx_GIVEREF(__pyx_tuple__33);
      __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(8, 0, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__33, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_resolver_cares_pyx, __pyx_n_s_getaddrinfo, 703, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) __PYX_ERR(0, 703, __pyx_L1_error)
    /* … */
      __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6gevent_8resolver_5cares_7channel_23getaddrinfo, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_channel_getaddrinfo, NULL, __pyx_n_s_gevent_resolver_cares, __pyx_d, ((PyObject *)__pyx_codeobj__34)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 703, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__35);
      if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_8resolver_5cares_channel->tp_dict, __pyx_n_s_getaddrinfo, __pyx_t_2) < 0) __PYX_ERR(0, 703, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      PyType_Modified(__pyx_ptype_6gevent_8resolver_5cares_channel);

     704:                     object callback,

     705:                     const char* name,

     706:                     object service, # AKA port

     707:                     int family=0,

     708:                     int type=0,

     709:                     int proto=0,

     710:                     int flags=0):

    +711:         if not self.channel:

      __pyx_t_1 = ((!(__pyx_v_self->channel != 0)) != 0);
      if (unlikely(__pyx_t_1)) {
    /* … */
      }

    +712:             raise gaierror(cares.ARES_EDESTRUCTION, 'this ares channel has been destroyed')

        __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_gaierror); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 712, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_4 = __Pyx_PyInt_From_int(ARES_EDESTRUCTION); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 712, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_5 = NULL;
        __pyx_t_6 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_5)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_5);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
            __pyx_t_6 = 1;
          }
        }
        {
          PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_t_4, __pyx_kp_s_this_ares_channel_has_been_destr};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6);
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 712, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        }
        __Pyx_Raise(__pyx_t_2, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __PYX_ERR(0, 712, __pyx_L1_error)

     713:

     714:         cdef cares.ares_addrinfo_hints hints

    +715:         memset(&hints, 0, sizeof(cares.ares_addrinfo_hints))

      (void)(memset((&__pyx_v_hints), 0, (sizeof(struct ares_addrinfo_hints))));

     716:

    +717:         hints.ai_flags = channel._convert_cares_ai_flags(flags)

      __pyx_v_hints.ai_flags = __pyx_f_6gevent_8resolver_5cares_7channel__convert_cares_ai_flags(__pyx_v_flags);

    +718:         hints.ai_family = family

      __pyx_v_hints.ai_family = __pyx_v_family;

    +719:         hints.ai_socktype = type

      __pyx_v_hints.ai_socktype = __pyx_v_type;

    +720:         hints.ai_protocol = proto

      __pyx_v_hints.ai_protocol = __pyx_v_proto;

    +721:         cdef object arg = (self, callback)

      __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 721, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF((PyObject *)__pyx_v_self);
      __Pyx_GIVEREF((PyObject *)__pyx_v_self);
      PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self));
      __Pyx_INCREF(__pyx_v_callback);
      __Pyx_GIVEREF(__pyx_v_callback);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_callback);
      __pyx_v_arg = __pyx_t_2;
      __pyx_t_2 = 0;

    +722:         Py_INCREF(arg)

      Py_INCREF(__pyx_v_arg);

     723:

    +724:         cares.ares_getaddrinfo(

      ares_getaddrinfo(__pyx_v_self->channel, __pyx_v_name, __pyx_t_7, (&__pyx_v_hints), ((void *)__pyx_f_6gevent_8resolver_5cares_7channel__getaddrinfo_cb), ((void *)__pyx_v_arg));

     725:             self.channel,

     726:             name,

    +727:             NULL if service is None else <char*>service,

      __pyx_t_1 = (__pyx_v_service == Py_None);
      if ((__pyx_t_1 != 0)) {
        __pyx_t_7 = NULL;
      } else {
        __pyx_t_8 = __Pyx_PyObject_AsWritableString(__pyx_v_service); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(0, 727, __pyx_L1_error)
        __pyx_t_7 = ((char *)__pyx_t_8);
      }

     728:             &hints,

     729:             <void*>channel._getaddrinfo_cb,

     730:             <void*>arg

     731:         )