Skip to content

Commit ef1ce03

Browse files
committed
Register the exception with py::register_local_exception()
1 parent aa7e1cc commit ef1ce03

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

dpnp/backend/extensions/lapack/lapack_py.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,10 @@ PYBIND11_MODULE(_lapack_impl, m)
8383
.value("C", oneapi::mkl::transpose::C)
8484
.export_values(); // Optional, allows access like `Transpose.N`
8585

86-
// Register a LinAlgError exception in the current submodule
87-
py::register_exception<lapack_ext::LinAlgError>(m, "LinAlgError",
88-
PyExc_ValueError);
86+
// Register a LinAlgError exception with local scope, meaning this is a
87+
// module-private exception (only used in that module)
88+
py::register_local_exception<lapack_ext::LinAlgError>(m, "LinAlgError",
89+
PyExc_ValueError);
8990

9091
init_dispatch_vectors();
9192
init_dispatch_tables();

0 commit comments

Comments
 (0)