mirror of
https://github.com/pybind/pybind11.git
synced 2026-06-06 06:11:25 +00:00
Replace "Unknown internal error occurred" with a more helpful message. (#3982)
This commit is contained in:
committed by
GitHub
parent
de4ba92c9f
commit
b24c5ed204
@@ -228,7 +228,10 @@ TEST_SUBMODULE(exceptions, m) {
|
||||
throw py::error_already_set();
|
||||
} catch (const std::runtime_error &e) {
|
||||
if ((err && e.what() != std::string("ValueError: foo"))
|
||||
|| (!err && e.what() != std::string("Unknown internal error occurred"))) {
|
||||
|| (!err
|
||||
&& e.what()
|
||||
!= std::string("Internal error: pybind11::error_already_set called "
|
||||
"while Python error indicator not set."))) {
|
||||
PyErr_Clear();
|
||||
throw std::runtime_error("error message mismatch");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user