[mlir][python] Fix PyOperationBase::walk not catching exception in python callback (#89225)

If the python callback throws an error, the c++ code will throw a
py::error_already_set that needs to be caught and handled in the c++
code .

This change is inspired by the similar solution in
PySymbolTable::walkSymbolTables.
GitOrigin-RevId: bc5536469d7854a043dbfe4c018e5b5dfc069d4f
2 files changed
tree: 598e939db838d35ac086a767e35e5c71234e5e7f
  1. benchmark/
  2. cmake/
  3. docs/
  4. examples/
  5. include/
  6. lib/
  7. python/
  8. test/
  9. tools/
  10. unittests/
  11. utils/
  12. .clang-format
  13. .clang-tidy
  14. CMakeLists.txt
  15. LICENSE.TXT
  16. README.md
README.md

Multi-Level Intermediate Representation

See https://mlir.llvm.org/ for more information.