mirror of
https://github.com/pybind/pybind11.git
synced 2024-12-02 18:07: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)
|
||||
result += str(value).cast<std::string>();
|
||||
|
||||
#if !defined(PYPY_VERSION)
|
||||
if (trace) {
|
||||
#if !defined(PYPY_VERSION)
|
||||
PyTracebackObject *tb = (PyTracebackObject *) trace;
|
||||
|
||||
// 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";
|
||||
frame = frame->f_back;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -335,8 +335,10 @@ public:
|
||||
|
||||
virtual const char* what() const noexcept override {
|
||||
if (m_lazy_what.empty()) {
|
||||
try {
|
||||
if (m_type)
|
||||
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());
|
||||
} catch (...) {
|
||||
return "Unknown internal error occurred";
|
||||
|
Loading…
Reference in New Issue
Block a user