MCPcopy Create free account
hub / github.com/numpy/numpy / call_converter_function

Function call_converter_function

numpy/core/src/multiarray/textreading/conversions.c:341–361  ·  view source on GitHub ↗

* Convert functions helper for the generic converter. */

Source from the content-addressed store, hash-verified

339 * Convert functions helper for the generic converter.
340 */
341static PyObject *
342call_converter_function(
343 PyObject *func, const Py_UCS4 *str, size_t length, bool byte_converters)
344{
345 PyObject *s = PyUnicode_FromKindAndData(PyUnicode_4BYTE_KIND, str, length);
346 if (s == NULL) {
347 return s;
348 }
349 if (byte_converters) {
350 Py_SETREF(s, PyUnicode_AsEncodedString(s, "latin1", NULL));
351 if (s == NULL) {
352 return NULL;
353 }
354 }
355 if (func == NULL) {
356 return s;
357 }
358 PyObject *result = PyObject_CallFunctionObjArgs(func, s, NULL);
359 Py_DECREF(s);
360 return result;
361}
362
363
364NPY_NO_EXPORT int

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected