aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/pybind11/patches/backtrace.patch
blob: 7e982191d4d44daead1abfe22868ea24f6ebc48e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
--- a/include/pybind11/detail/internals.h   (index)
+++ b/include/pybind11/detail/internals.h   (working tree)
@@ -12,6 +12,8 @@
 #include <exception>
 #include <mutex>
 #include <thread>
+#include <util/generic/yexception.h>
+#include <util/string/builder.h>

 /// Tracks the `internals` and `type_info` ABI version independent of the main library version.
 ///
@@ -384,7 +386,8 @@ inline void translate_exception(std::exception_ptr p) {
         return;
     } catch (const std::exception &e) {
         handle_nested_exception(e, p);
-        raise_err(PyExc_RuntimeError, e.what());
+        TString message = TStringBuilder() << TBackTrace::FromCurrentException().PrintToString() << Endl << e.what() << Endl;
+        raise_err(PyExc_RuntimeError, message.c_str());
         return;
     } catch (const std::nested_exception &e) {
         handle_nested_exception(e, p);