@@ -530,8 +530,7 @@ PyArray_ConcatenateArrays(int narrays, PyArrayObject **arrays, int axis,
530
530
NPY_NO_EXPORT PyArrayObject *
531
531
PyArray_ConcatenateFlattenedArrays (int narrays , PyArrayObject * * arrays ,
532
532
NPY_ORDER order , PyArrayObject * ret ,
533
- PyArray_Descr * dtype , NPY_CASTING casting ,
534
- npy_bool casting_not_passed )
533
+ PyArray_Descr * dtype , NPY_CASTING casting )
535
534
{
536
535
int iarrays ;
537
536
npy_intp shape = 0 ;
@@ -647,12 +646,11 @@ PyArray_ConcatenateFlattenedArrays(int narrays, PyArrayObject **arrays,
647
646
* @param ret output array to fill
648
647
* @param dtype Forced output array dtype (cannot be combined with ret)
649
648
* @param casting Casting mode used
650
- * @param casting_not_passed Deprecation helper
651
649
*/
652
650
NPY_NO_EXPORT PyObject *
653
651
PyArray_ConcatenateInto (PyObject * op ,
654
652
int axis , PyArrayObject * ret , PyArray_Descr * dtype ,
655
- NPY_CASTING casting , npy_bool casting_not_passed )
653
+ NPY_CASTING casting )
656
654
{
657
655
int iarrays , narrays ;
658
656
PyArrayObject * * arrays ;
@@ -698,7 +696,7 @@ PyArray_ConcatenateInto(PyObject *op,
698
696
if (axis == NPY_RAVEL_AXIS ) {
699
697
ret = PyArray_ConcatenateFlattenedArrays (
700
698
narrays , arrays , NPY_CORDER , ret , dtype ,
701
- casting , casting_not_passed );
699
+ casting );
702
700
}
703
701
else {
704
702
ret = PyArray_ConcatenateArrays (
@@ -743,7 +741,7 @@ PyArray_Concatenate(PyObject *op, int axis)
743
741
casting = NPY_SAME_KIND_CASTING ;
744
742
}
745
743
return PyArray_ConcatenateInto (
746
- op , axis , NULL , NULL , casting , 0 );
744
+ op , axis , NULL , NULL , casting );
747
745
}
748
746
749
747
static int
@@ -2489,7 +2487,6 @@ array_concatenate(PyObject *NPY_UNUSED(dummy),
2489
2487
PyObject * out = NULL ;
2490
2488
PyArray_Descr * dtype = NULL ;
2491
2489
NPY_CASTING casting = NPY_SAME_KIND_CASTING ;
2492
- PyObject * casting_obj = NULL ;
2493
2490
PyObject * res ;
2494
2491
int axis = 0 ;
2495
2492
@@ -2499,22 +2496,10 @@ array_concatenate(PyObject *NPY_UNUSED(dummy),
2499
2496
"|axis" , & PyArray_AxisConverter , & axis ,
2500
2497
"|out" , NULL , & out ,
2501
2498
"$dtype" , & PyArray_DescrConverter2 , & dtype ,
2502
- "$casting" , NULL , & casting_obj ,
2499
+ "$casting" , & PyArray_CastingConverter , & casting ,
2503
2500
NULL , NULL , NULL ) < 0 ) {
2504
2501
return NULL ;
2505
2502
}
2506
- int casting_not_passed = 0 ;
2507
- if (casting_obj == NULL ) {
2508
- /*
2509
- * Casting was not passed in, needed for deprecation only.
2510
- * This should be simplified once the deprecation is finished.
2511
- */
2512
- casting_not_passed = 1 ;
2513
- }
2514
- else if (!PyArray_CastingConverter (casting_obj , & casting )) {
2515
- Py_XDECREF (dtype );
2516
- return NULL ;
2517
- }
2518
2503
if (out != NULL ) {
2519
2504
if (out == Py_None ) {
2520
2505
out = NULL ;
@@ -2526,7 +2511,7 @@ array_concatenate(PyObject *NPY_UNUSED(dummy),
2526
2511
}
2527
2512
}
2528
2513
res = PyArray_ConcatenateInto (a0 , axis , (PyArrayObject * )out , dtype ,
2529
- casting , casting_not_passed );
2514
+ casting );
2530
2515
Py_XDECREF (dtype );
2531
2516
return res ;
2532
2517
}
0 commit comments