Skip to content

Commit

Permalink
[pybind] update py::exception<>::operator() to py::set_error (#63805
Browse files Browse the repository at this point in the history
)
  • Loading branch information
gouzil committed Apr 24, 2024
1 parent 3ecff11 commit 71fd732
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions paddle/fluid/pybind/exception.cc
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ void BindException(pybind11::module* m) {
try {
if (p) std::rethrow_exception(p);
} catch (const platform::EOFException& e) {
eof(e.what());
pybind11::set_error(eof, e.what());
} catch (const memory::allocation::BadAlloc& e) {
PyErr_SetString(PyExc_MemoryError, e.what());
} catch (const platform::EnforceNotMet& e) {
Expand Down Expand Up @@ -77,7 +77,7 @@ void BindException(pybind11::module* m) {
PyErr_SetString(PyExc_TypeError, e.what());
break;
default:
exc(e.what());
pybind11::set_error(exc, e.what());
break;
}
}
Expand Down

0 comments on commit 71fd732

Please sign in to comment.