Skip to content

Commit

Permalink
Fixed importing from errno submodule in Python 3
Browse files Browse the repository at this point in the history
  • Loading branch information
saghul committed Apr 4, 2014
1 parent 0ee476d commit fabe28c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/pycares.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit fabe28c

Please sign in to comment.