How to use the pycares.errno.errorcode function in pycares

To help you get started, we’ve selected a few pycares examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github saghul / pycares / tests / tests.py View on Github external
def test_errorcode_dict(self):
        for err in ('ARES_SUCCESS', 'ARES_ENODATA', 'ARES_ECANCELLED'):
            val = getattr(pycares.errno, err)
            self.assertEqual(pycares.errno.errorcode[val], err)
github saghul / pycares / tests / tests.py View on Github external
def test_strerror_str(self):
        for key in pycares.errno.errorcode:
            self.assertTrue(type(pycares.errno.strerror(key)), str)
github slimta / python-slimta / slimta / util / dns.py View on Github external
def __init__(self, errno):
        str_error = pycares.errno.strerror(errno)
        if isinstance(str_error, bytes):
            str_error = str_error.decode('utf-8')
        msg = '{0} [{1}]'.format(str_error, pycares.errno.errorcode[errno])
        super(DNSError, self).__init__(msg)
        self.errno = errno