| 109 | } |
| 110 | |
| 111 | py::dtype ToDType(const py::buffer_info &info) |
| 112 | { |
| 113 | std::string fmt = ProcessBufferInfoFormat(info.format); |
| 114 | |
| 115 | PyObject *ptr = nullptr; |
| 116 | if ((py::detail::npy_api::get().PyArray_DescrConverter_(py::str(fmt).ptr(), &ptr) == 0) || !ptr) |
| 117 | { |
| 118 | PyErr_Clear(); |
| 119 | return py::dtype(info); |
| 120 | } |
| 121 | else |
| 122 | { |
| 123 | return py::dtype(fmt); |
| 124 | } |
| 125 | } |
| 126 | |
| 127 | py::dtype ToDType(const std::string &fmt) |
| 128 | { |
nothing calls this directly
no test coverage detected