Edward Catmur added the comment:
Report dlerror() if dlsym() fails.
The error output is now something like:
ImportError: /<...>/foo.cpython-34dm.so: undefined symbol: PyInit_bar
--
keywords: +patch
Added file: http://bugs.python.org/file32643/dynload_report_dlerror.patch
_
New submission from Edward Catmur:
foo.c:
#include
static PyMethodDef mth[] = { {NULL, NULL, 0, NULL} };
static struct PyModuleDef mod = { PyModuleDef_HEAD_INIT, "foo", NULL, -1, mth };
PyMODINIT_FUNC PyInit_foo(void) { return PyModule_Create(&mod); }
bar.c:
#include
static PyMethodDef mth[]