Commit f4081806 authored by Peter Bell's avatar Peter Bell
Browse files

Don't use exceptions as normal control flow

parent 4e1f2c3b
......@@ -152,15 +152,12 @@ template<typename T> py::array sym_rfftn_internal(const py::array &in,
py::array fftn(const py::array &a, py::object axes, int inorm, bool inplace,
size_t nthreads)
{
try {
if (a.dtype().kind() == 'c')
return xfftn(a, axes, inorm, inplace, true, nthreads);
}
catch (runtime_error &)
{
if (inplace) throw runtime_error("cannot do this operation in-place");
DISPATCH(a, f64, f32, flong, sym_rfftn_internal, (a, axes, inorm, nthreads))
}
}
py::array ifftn(const py::array &a, py::object axes, int inorm,
bool inplace, size_t nthreads)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment