Skip to content

Commit 9ad3313

Browse files
committed
Fix deprecated elementwise comparison warning / error.
1 parent bf9a033 commit 9ad3313

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

include/boost/python/numpy/ufunc.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ struct unary_ufunc
106106
dtype in_dtype = dtype::get_builtin<TArgument>();
107107
dtype out_dtype = dtype::get_builtin<TResult>();
108108
ndarray in_array = from_object(input, in_dtype, ndarray::ALIGNED);
109-
ndarray out_array = (output != object()) ?
109+
ndarray out_array = ! output.is_none() ?
110110
from_object(output, out_dtype, ndarray::ALIGNED | ndarray::WRITEABLE)
111111
: zeros(in_array.get_nd(), in_array.get_shape(), out_dtype);
112112
multi_iter iter = make_multi_iter(in_array, out_array);
@@ -171,7 +171,7 @@ struct binary_ufunc
171171
ndarray in1_array = from_object(input1, in1_dtype, ndarray::ALIGNED);
172172
ndarray in2_array = from_object(input2, in2_dtype, ndarray::ALIGNED);
173173
multi_iter iter = make_multi_iter(in1_array, in2_array);
174-
ndarray out_array = (output != object())
174+
ndarray out_array = !output.is_none()
175175
? from_object(output, out_dtype, ndarray::ALIGNED | ndarray::WRITEABLE)
176176
: zeros(iter.get_nd(), iter.get_shape(), out_dtype);
177177
iter = make_multi_iter(in1_array, in2_array, out_array);

0 commit comments

Comments
 (0)