File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
numpy/_core/src/multiarray/stringdtype Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -850,14 +850,17 @@ init_string_dtype(void)
850850 return -1 ;
851851 }
852852
853- PyArray_Descr * singleton =
854- NPY_DT_CALL_default_descr (& PyArray_StringDType );
853+ PyArray_StringDTypeObject * singleton =
854+ ( PyArray_StringDTypeObject * ) NPY_DT_CALL_default_descr (& PyArray_StringDType );
855855
856856 if (singleton == NULL ) {
857857 return -1 ;
858858 }
859859
860- PyArray_StringDType .singleton = singleton ;
860+ // never associate the singleton with an array
861+ singleton -> array_owned = 1 ;
862+
863+ PyArray_StringDType .singleton = (PyArray_Descr * )singleton ;
861864 PyArray_StringDType .type_num = NPY_VSTRING ;
862865
863866 for (int i = 0 ; PyArray_StringDType_casts [i ] != NULL ; i ++ ) {
You can’t perform that action at this time.
0 commit comments