| 180 | } |
| 181 | |
| 182 | static inline PyArray_Descr* GetSafeNumPyDtype(int type) { |
| 183 | if (type == NPY_DATETIME || type == NPY_TIMEDELTA) { |
| 184 | // It is not safe to mutate the result of DescrFromType for datetime and |
| 185 | // timedelta descriptors |
| 186 | return PyArray_DescrNewFromType(type); |
| 187 | } else { |
| 188 | return PyArray_DescrFromType(type); |
| 189 | } |
| 190 | } |
| 191 | |
| 192 | } // namespace internal |
| 193 |
no outgoing calls
no test coverage detected