diff options
Diffstat (limited to 'sources/shiboken6/libshiboken/basewrapper.cpp')
| -rw-r--r-- | sources/shiboken6/libshiboken/basewrapper.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sources/shiboken6/libshiboken/basewrapper.cpp b/sources/shiboken6/libshiboken/basewrapper.cpp index 4b69abd4d..1bcc27218 100644 --- a/sources/shiboken6/libshiboken/basewrapper.cpp +++ b/sources/shiboken6/libshiboken/basewrapper.cpp @@ -869,10 +869,10 @@ static std::string msgFailedToInitializeType(const char *description) { std::ostringstream stream; stream << "libshiboken: Failed to initialize " << description; - if (auto *error = PepErr_GetRaisedException()) { - if (auto *str = PyObject_Str(error)) + if (PyErr_Occurred() != nullptr) { + Shiboken::Errors::Stash stash; + if (auto *str = PyObject_Str(stash.getException())) stream << ": " << Shiboken::String::toCString(str); - Py_DECREF(error); } stream << '.'; return stream.str(); |
