24 d = PyObject_GetAttrString(module, (
char *)
"__pyx_capi__");
27 cobj = PyDict_GetItemString(d, funcname);
29 PyErr_Format(PyExc_ImportError,
30 "%.200s does not export expected C function %.200s",
31 PyModule_GetName(module), funcname);
34 if (!PyCapsule_IsValid(cobj, sig)) {
35 PyErr_Format(PyExc_TypeError,
36 "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)",
37 PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj));
40 tmp.p = PyCapsule_GetPointer(cobj, sig);