mirror of
https://github.com/pybind/pybind11.git
synced 2024-12-03 18:37:12 +00:00
Fixed PyPy build
This commit is contained in:
parent
b48bc720e0
commit
115a757a5d
@ -415,8 +415,8 @@ PYBIND11_NOINLINE inline std::string error_string(PyObject *type, PyObject *valu
|
|||||||
if (value)
|
if (value)
|
||||||
result += str(value).cast<std::string>();
|
result += str(value).cast<std::string>();
|
||||||
|
|
||||||
#if !defined(PYPY_VERSION)
|
|
||||||
if (trace) {
|
if (trace) {
|
||||||
|
#if !defined(PYPY_VERSION)
|
||||||
PyTracebackObject *tb = (PyTracebackObject *) trace;
|
PyTracebackObject *tb = (PyTracebackObject *) trace;
|
||||||
|
|
||||||
// Get the deepest trace possible.
|
// Get the deepest trace possible.
|
||||||
@ -433,8 +433,8 @@ PYBIND11_NOINLINE inline std::string error_string(PyObject *type, PyObject *valu
|
|||||||
handle(frame->f_code->co_name).cast<std::string>() + "\n";
|
handle(frame->f_code->co_name).cast<std::string>() + "\n";
|
||||||
frame = frame->f_back;
|
frame = frame->f_back;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@ -335,8 +335,10 @@ public:
|
|||||||
|
|
||||||
virtual const char* what() const noexcept override {
|
virtual const char* what() const noexcept override {
|
||||||
if (m_lazy_what.empty()) {
|
if (m_lazy_what.empty()) {
|
||||||
try {
|
if (m_type)
|
||||||
PyErr_NormalizeException(&m_type.ptr(), &m_value.ptr(), &m_trace.ptr());
|
PyErr_NormalizeException(&m_type.ptr(), &m_value.ptr(), &m_trace.ptr());
|
||||||
|
|
||||||
|
try {
|
||||||
m_lazy_what = detail::error_string(m_type.ptr(), m_value.ptr(), m_trace.ptr());
|
m_lazy_what = detail::error_string(m_type.ptr(), m_value.ptr(), m_trace.ptr());
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
return "Unknown internal error occurred";
|
return "Unknown internal error occurred";
|
||||||
|
Loading…
Reference in New Issue
Block a user