From 932d6519bcd8224bbb774cb3cd1a3373fa092a83 Mon Sep 17 00:00:00 2001 From: Adam Debreceni Date: Tue, 5 Nov 2024 13:17:43 +0100 Subject: [PATCH] MINIFICPP-2487 - Destroy PyException while holding GIL --- extensions/python/PythonScriptEngine.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extensions/python/PythonScriptEngine.h b/extensions/python/PythonScriptEngine.h index 5823d6f1e2..4a266ea572 100644 --- a/extensions/python/PythonScriptEngine.h +++ b/extensions/python/PythonScriptEngine.h @@ -81,7 +81,7 @@ class PythonScriptEngine { if (auto item = bindings_[fn_name]) { auto result = BorrowedCallable(*item)(std::forward(args)...); if (!result) { - throw PyException(); + throw PythonScriptException(PyException().what()); } return result; } else { @@ -136,7 +136,7 @@ class PythonScriptEngine { auto result = callable_method(std::forward(args)...); if (!result) { - throw PyException(); + throw PythonScriptException(PyException().what()); } return result; }