From 69dc380c0dcb3ee057165844f270c48a1b98c625 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Kreuzberger?= Date: Mon, 10 Jun 2019 22:00:55 +0200 Subject: [PATCH] #1208 Handle forced unwind exception (e.g. during pthread termination) * #1208 Bugfix thread kill wihile running pybind11 module * #1208 Bugfix missing space after catch --- include/pybind11/pybind11.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/include/pybind11/pybind11.h b/include/pybind11/pybind11.h index 785c1c006..3c83b5744 100644 --- a/include/pybind11/pybind11.h +++ b/include/pybind11/pybind11.h @@ -41,6 +41,11 @@ # endif #endif +#if defined(__GNUG__) && !defined(__clang__) + #include +#endif + + #include "attr.h" #include "options.h" #include "detail/class.h" @@ -663,6 +668,10 @@ protected: } catch (error_already_set &e) { e.restore(); return nullptr; +#if defined(__GNUG__) && !defined(__clang__) + } catch ( abi::__forced_unwind& ) { + throw; +#endif } catch (...) { /* When an exception is caught, give each registered exception translator a chance to translate it to a Python exception