22 d = PyObject_GetAttrString(module, (
char *)
"__pyx_capi__");
25 cobj = PyDict_GetItemString(d, funcname);
27 PyErr_Format(PyExc_ImportError,
28 "%.200s does not export expected C function %.200s",
29 PyModule_GetName(module), funcname);
32 if (!PyCapsule_IsValid(cobj, sig)) {
33 PyErr_Format(PyExc_TypeError,
34 "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)",
35 PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj));
38 tmp.p = PyCapsule_GetPointer(cobj, sig);