Skip to content
Snippets Groups Projects

Don't use exceptions as normal control flow

Merged Peter Bell requested to merge no-exceptions into new_norm
1 file
+ 3
6
Compare changes
  • Side-by-side
  • Inline
+ 3
6
@@ -152,14 +152,11 @@ 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 {
return xfftn(a, axes, inorm, inplace, true, nthreads);
}
catch (runtime_error &)
{
if (a.dtype().kind() == 'c')
return xfftn(a, axes, inorm, inplace, true, nthreads);
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,
Loading