@@ -982,7 +982,7 @@ PyArray_MatrixProduct2(PyObject *op1, PyObject *op2, PyArrayObject* out)
982
982
for (i = 0 ; i < PyArray_NDIM (ap2 ) - 2 ; i ++ ) {
983
983
dimensions [j ++ ] = PyArray_DIMS (ap2 )[i ];
984
984
}
985
- if (PyArray_NDIM (ap2 ) > 1 ) {
985
+ if (PyArray_NDIM (ap2 ) > 1 ) {
986
986
dimensions [j ++ ] = PyArray_DIMS (ap2 )[PyArray_NDIM (ap2 )- 1 ];
987
987
}
988
988
@@ -1318,7 +1318,7 @@ PyArray_Correlate2(PyObject *op1, PyObject *op2, int mode)
1318
1318
*/
1319
1319
if (inverted ) {
1320
1320
st = _pyarray_revert (ret );
1321
- if (st ) {
1321
+ if (st ) {
1322
1322
goto clean_ret ;
1323
1323
}
1324
1324
}
@@ -1365,7 +1365,7 @@ PyArray_Correlate(PyObject *op1, PyObject *op2, int mode)
1365
1365
}
1366
1366
1367
1367
ret = _pyarray_correlate (ap1 , ap2 , typenum , mode , & unused );
1368
- if (ret == NULL ) {
1368
+ if (ret == NULL ) {
1369
1369
goto fail ;
1370
1370
}
1371
1371
Py_DECREF (ap1 );
@@ -1654,7 +1654,7 @@ _array_fromobject(PyObject *NPY_UNUSED(ignored), PyObject *args, PyObject *kws)
1654
1654
}
1655
1655
1656
1656
full_path :
1657
- if (!PyArg_ParseTupleAndKeywords (args , kws , "O|O&O&O&O&i:array" , kwd ,
1657
+ if (!PyArg_ParseTupleAndKeywords (args , kws , "O|O&O&O&O&i:array" , kwd ,
1658
1658
& op ,
1659
1659
PyArray_DescrConverter2 , & type ,
1660
1660
PyArray_BoolConverter , & copy ,
@@ -2489,7 +2489,7 @@ einsum_sub_op_from_lists(PyObject *args,
2489
2489
"operand and a subscripts list to einsum" );
2490
2490
return -1 ;
2491
2491
}
2492
- else if (nop >= NPY_MAXARGS ) {
2492
+ else if (nop >= NPY_MAXARGS ) {
2493
2493
PyErr_SetString (PyExc_ValueError , "too many operands" );
2494
2494
return -1 ;
2495
2495
}
@@ -2724,7 +2724,7 @@ array_arange(PyObject *NPY_UNUSED(ignored), PyObject *args, PyObject *kws) {
2724
2724
static char * kwd []= {"start" , "stop" , "step" , "dtype" , NULL };
2725
2725
PyArray_Descr * typecode = NULL ;
2726
2726
2727
- if (!PyArg_ParseTupleAndKeywords (args , kws , "O|OOO&:arange" , kwd ,
2727
+ if (!PyArg_ParseTupleAndKeywords (args , kws , "O|OOO&:arange" , kwd ,
2728
2728
& o_start ,
2729
2729
& o_stop ,
2730
2730
& o_step ,
@@ -2762,7 +2762,7 @@ array__get_ndarray_c_version(PyObject *NPY_UNUSED(dummy), PyObject *args, PyObje
2762
2762
{
2763
2763
static char * kwlist [] = {NULL };
2764
2764
2765
- if (!PyArg_ParseTupleAndKeywords (args , kwds , "" , kwlist )) {
2765
+ if (!PyArg_ParseTupleAndKeywords (args , kwds , "" , kwlist )) {
2766
2766
return NULL ;
2767
2767
}
2768
2768
return PyInt_FromLong ( (long ) PyArray_GetNDArrayCVersion () );
@@ -2835,7 +2835,7 @@ array_set_string_function(PyObject *NPY_UNUSED(self), PyObject *args,
2835
2835
int repr = 1 ;
2836
2836
static char * kwlist [] = {"f" , "repr" , NULL };
2837
2837
2838
- if (!PyArg_ParseTupleAndKeywords (args , kwds , "|Oi:set_string_function" , kwlist , & op , & repr )) {
2838
+ if (!PyArg_ParseTupleAndKeywords (args , kwds , "|Oi:set_string_function" , kwlist , & op , & repr )) {
2839
2839
return NULL ;
2840
2840
}
2841
2841
/* reset the array_repr function to built-in */
@@ -3145,7 +3145,7 @@ array_promote_types(PyObject *NPY_UNUSED(dummy), PyObject *args)
3145
3145
PyArray_Descr * d1 = NULL ;
3146
3146
PyArray_Descr * d2 = NULL ;
3147
3147
PyObject * ret = NULL ;
3148
- if (!PyArg_ParseTuple (args , "O&O&:promote_types" ,
3148
+ if (!PyArg_ParseTuple (args , "O&O&:promote_types" ,
3149
3149
PyArray_DescrConverter2 , & d1 , PyArray_DescrConverter2 , & d2 )) {
3150
3150
goto finish ;
3151
3151
}
@@ -3171,7 +3171,7 @@ array_min_scalar_type(PyObject *NPY_UNUSED(dummy), PyObject *args)
3171
3171
PyArrayObject * array ;
3172
3172
PyObject * ret = NULL ;
3173
3173
3174
- if (!PyArg_ParseTuple (args , "O:min_scalar_type" , & array_in )) {
3174
+ if (!PyArg_ParseTuple (args , "O:min_scalar_type" , & array_in )) {
3175
3175
return NULL ;
3176
3176
}
3177
3177
@@ -3248,7 +3248,7 @@ array_datetime_data(PyObject *NPY_UNUSED(dummy), PyObject *args)
3248
3248
PyArray_Descr * dtype ;
3249
3249
PyArray_DatetimeMetaData * meta ;
3250
3250
3251
- if (!PyArg_ParseTuple (args , "O&:datetime_data" ,
3251
+ if (!PyArg_ParseTuple (args , "O&:datetime_data" ,
3252
3252
PyArray_DescrConverter , & dtype )) {
3253
3253
return NULL ;
3254
3254
}
@@ -3267,7 +3267,7 @@ new_buffer(PyObject *NPY_UNUSED(dummy), PyObject *args)
3267
3267
{
3268
3268
int size ;
3269
3269
3270
- if (!PyArg_ParseTuple (args , "i:buffer" , & size )) {
3270
+ if (!PyArg_ParseTuple (args , "i:buffer" , & size )) {
3271
3271
return NULL ;
3272
3272
}
3273
3273
return PyBuffer_New (size );
@@ -4570,6 +4570,10 @@ PyMODINIT_FUNC init_multiarray_umath(void) {
4570
4570
*/
4571
4571
PyArray_Type .tp_hash = PyObject_HashNotImplemented ;
4572
4572
4573
+ if (PyType_Ready (& PyUFunc_Type ) < 0 ) {
4574
+ goto err ;
4575
+ }
4576
+
4573
4577
/* Load the ufunc operators into the array module's namespace */
4574
4578
if (InitOperators (d ) < 0 ) {
4575
4579
goto err ;
@@ -4580,8 +4584,9 @@ PyMODINIT_FUNC init_multiarray_umath(void) {
4580
4584
}
4581
4585
initialize_casting_tables ();
4582
4586
initialize_numeric_types ();
4583
- if (initscalarmath (m ) < 0 )
4587
+ if (initscalarmath (m ) < 0 ) {
4584
4588
goto err ;
4589
+ }
4585
4590
4586
4591
if (PyType_Ready (& PyArray_Type ) < 0 ) {
4587
4592
goto err ;
0 commit comments