mirror of
https://github.com/pybind/pybind11.git
synced 2026-05-12 01:10:34 +00:00
fix: unicode surrogate character in Python exception message. (#4297)
* Fix & test for issue #4288 (unicode surrogate character in Python exception message). * DRY `message_unavailable_exc` * fix: add a constexpr Co-authored-by: Aaron Gokaslan <skylion.aaron@gmail.com> * style: pre-commit fixes Co-authored-by: Henry Schreiner <HenrySchreinerIII@gmail.com> Co-authored-by: Aaron Gokaslan <skylion.aaron@gmail.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
committed by
Ralf W. Grosse-Kunstleve
parent
6d3a0fc319
commit
c3987b1aad
@@ -105,11 +105,6 @@ struct PythonAlreadySetInDestructor {
|
||||
py::str s;
|
||||
};
|
||||
|
||||
std::string error_already_set_what(const py::object &exc_type, const py::object &exc_value) {
|
||||
PyErr_SetObject(exc_type.ptr(), exc_value.ptr());
|
||||
return py::error_already_set().what();
|
||||
}
|
||||
|
||||
TEST_SUBMODULE(exceptions, m) {
|
||||
m.def("throw_std_exception",
|
||||
[]() { throw std::runtime_error("This exception was intentionally thrown."); });
|
||||
|
||||
Reference in New Issue
Block a user