@@ -1047,7 +1047,7 @@ array_boolean_subscript(PyArrayObject *self,
1047
1047
Py_INCREF (dtype );
1048
1048
ret = (PyArrayObject * )PyArray_NewFromDescr (Py_TYPE (self ), dtype , 1 ,
1049
1049
& size , PyArray_STRIDES (ret ), PyArray_BYTES (ret ),
1050
- 0 , (PyObject * )self );
1050
+ PyArray_FLAGS ( self ) , (PyObject * )self );
1051
1051
1052
1052
if (ret == NULL ) {
1053
1053
Py_DECREF (tmp );
@@ -1058,9 +1058,6 @@ array_boolean_subscript(PyArrayObject *self,
1058
1058
Py_DECREF (ret );
1059
1059
return NULL ;
1060
1060
}
1061
- if (_IsWriteable (ret )) {
1062
- PyArray_ENABLEFLAGS (ret , NPY_ARRAY_WRITEABLE );
1063
- }
1064
1061
}
1065
1062
1066
1063
return ret ;
@@ -1572,7 +1569,7 @@ array_subscript(PyArrayObject *self, PyObject *op)
1572
1569
PyArray_SHAPE (tmp_arr ),
1573
1570
PyArray_STRIDES (tmp_arr ),
1574
1571
PyArray_BYTES (tmp_arr ),
1575
- 0 , /* TODO: Flags? */
1572
+ PyArray_FLAGS ( self ),
1576
1573
(PyObject * )self );
1577
1574
1578
1575
if (result == NULL ) {
@@ -1586,9 +1583,6 @@ array_subscript(PyArrayObject *self, PyObject *op)
1586
1583
result = NULL ;
1587
1584
goto finish ;
1588
1585
}
1589
- if (_IsWriteable (result )) {
1590
- PyArray_ENABLEFLAGS (result , NPY_ARRAY_WRITEABLE );
1591
- }
1592
1586
}
1593
1587
1594
1588
finish :
@@ -1813,7 +1807,8 @@ array_assign_subscript(PyArrayObject *self, PyObject *ind, PyObject *op)
1813
1807
* check to allow wrong dimensional boolean arrays in all cases.
1814
1808
*/
1815
1809
if (PyArray_NDIM (tmp_arr ) > 1 ) {
1816
- if (attempt_1d_fallback (self , indices [0 ].object , tmp_arr ) < 0 ) {
1810
+ if (attempt_1d_fallback (self , indices [0 ].object ,
1811
+ (PyObject * )tmp_arr ) < 0 ) {
1817
1812
goto fail ;
1818
1813
}
1819
1814
goto success ;
0 commit comments