NpyArg_ParseKeywords * * Utility function that provides the keyword parsing functionality of * PyArg_ParseTupleAndKeywords without having to have an args argument. * */
| 43 | * |
| 44 | */ |
| 45 | static int |
| 46 | NpyArg_ParseKeywords(PyObject *keys, const char *format, char **kwlist, ...) |
| 47 | { |
| 48 | PyObject *args = PyTuple_New(0); |
| 49 | int ret; |
| 50 | va_list va; |
| 51 | |
| 52 | if (args == NULL) { |
| 53 | PyErr_SetString(PyExc_RuntimeError, |
| 54 | "Failed to allocate new tuple"); |
| 55 | return 0; |
| 56 | } |
| 57 | va_start(va, kwlist); |
| 58 | ret = PyArg_VaParseTupleAndKeywords(args, keys, format, kwlist, va); |
| 59 | va_end(va); |
| 60 | Py_DECREF(args); |
| 61 | return ret; |
| 62 | } |
| 63 | |
| 64 | |
| 65 | /* |
no outgoing calls
no test coverage detected