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)
850
850
return -1 ;
851
851
}
852
852
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 );
855
855
856
856
if (singleton == NULL ) {
857
857
return -1 ;
858
858
}
859
859
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 ;
861
864
PyArray_StringDType .type_num = NPY_VSTRING ;
862
865
863
866
for (int i = 0 ; PyArray_StringDType_casts [i ] != NULL ; i ++ ) {
You can’t perform that action at this time.
0 commit comments