| 750 | |
| 751 | |
| 752 | static int |
| 753 | array_real_set(PyArrayObject *self, PyObject *val, void *NPY_UNUSED(ignored)) |
| 754 | { |
| 755 | PyArrayObject *ret; |
| 756 | PyArrayObject *new; |
| 757 | int retcode; |
| 758 | |
| 759 | if (val == NULL) { |
| 760 | PyErr_SetString(PyExc_AttributeError, |
| 761 | "Cannot delete array real part"); |
| 762 | return -1; |
| 763 | } |
| 764 | if (PyArray_ISCOMPLEX(self)) { |
| 765 | ret = _get_part(self, 0); |
| 766 | if (ret == NULL) { |
| 767 | return -1; |
| 768 | } |
| 769 | } |
| 770 | else { |
| 771 | Py_INCREF(self); |
| 772 | ret = self; |
| 773 | } |
| 774 | new = (PyArrayObject *)PyArray_FROM_O(val); |
| 775 | if (new == NULL) { |
| 776 | Py_DECREF(ret); |
| 777 | return -1; |
| 778 | } |
| 779 | retcode = PyArray_MoveInto(ret, new); |
| 780 | Py_DECREF(ret); |
| 781 | Py_DECREF(new); |
| 782 | return retcode; |
| 783 | } |
| 784 | |
| 785 | /* For Object arrays we need to get |
| 786 | and set the imaginary part of |
nothing calls this directly
no test coverage detected