From fabe28cf174b3ccd65910d9a6bc7460e677b57e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sa=C3=BAl=20Ibarra=20Corretg=C3=A9?= Date: Fri, 4 Apr 2014 10:10:30 +0200 Subject: [PATCH] Fixed importing from errno submodule in Python 3 --- src/pycares.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/pycares.c b/src/pycares.c index 384964c..96e90a7 100644 --- a/src/pycares.c +++ b/src/pycares.c @@ -91,6 +91,10 @@ init_pycares(void) goto fail; } PyCaresModule_AddObject(pycares, "errno", errno_module); +#ifdef PYCARES_PYTHON3 + PyDict_SetItemString(PyImport_GetModuleDict(), pycares_errorno_module.m_name, errno_module); + Py_DECREF(errno_module); +#endif /* Exceptions */ PyExc_AresError = PyErr_NewException("pycares.AresError", NULL, NULL);