[Mlir-commits] [mlir] [mlir][python] Fix Python binding cast diagnostics for nanobind 2.13 (PR #206391)

Maksim Levental llvmlistbot at llvm.org
Sun Jun 28 20:49:22 PDT 2026


================
@@ -43,14 +43,15 @@ static void pyListToVector(const nb::sequence &list, std::vector<CType> &result,
   for (nb::handle item : list) {
     try {
       result.push_back(nb::cast<PyType>(item));
-    } catch (nb::cast_error &err) {
+    } catch (std::exception &err) {
----------------
makslevental wrote:

I don't understand - by too broad you mean it'll catch `bad_alloc`s as well as cast failures? Anyway I think conflating `bad_alloc` with a cast failure is pretty unlikely (if we can't allocate then we're in bigger trouble).

https://github.com/llvm/llvm-project/pull/206391


More information about the Mlir-commits mailing list