* Convert function which replaces np._NoValue with NULL. * As a converter returns 0 on error and 1 on success. */
| 3940 | * As a converter returns 0 on error and 1 on success. |
| 3941 | */ |
| 3942 | static int |
| 3943 | _not_NoValue(PyObject *obj, PyObject **out) |
| 3944 | { |
| 3945 | static PyObject *NoValue = NULL; |
| 3946 | npy_cache_import("numpy", "_NoValue", &NoValue); |
| 3947 | if (NoValue == NULL) { |
| 3948 | return 0; |
| 3949 | } |
| 3950 | if (obj == NoValue) { |
| 3951 | *out = NULL; |
| 3952 | } |
| 3953 | else { |
| 3954 | *out = obj; |
| 3955 | } |
| 3956 | return 1; |
| 3957 | } |
| 3958 | |
| 3959 | |
| 3960 | /* forward declaration */ |
nothing calls this directly
no test coverage detected