#1208 Handle forced unwind exception (e.g. during pthread termination)

* #1208 Bugfix thread kill wihile running pybind11 module

* #1208 Bugfix missing space after catch
This commit is contained in:
Jörg Kreuzberger 2019-06-10 22:00:55 +02:00 committed by Wenzel Jakob
parent 09330b94ea
commit 69dc380c0d

View File

@ -41,6 +41,11 @@
# endif # endif
#endif #endif
#if defined(__GNUG__) && !defined(__clang__)
#include <cxxabi.h>
#endif
#include "attr.h" #include "attr.h"
#include "options.h" #include "options.h"
#include "detail/class.h" #include "detail/class.h"
@ -663,6 +668,10 @@ protected:
} catch (error_already_set &e) { } catch (error_already_set &e) {
e.restore(); e.restore();
return nullptr; return nullptr;
#if defined(__GNUG__) && !defined(__clang__)
} catch ( abi::__forced_unwind& ) {
throw;
#endif
} catch (...) { } catch (...) {
/* When an exception is caught, give each registered exception /* When an exception is caught, give each registered exception
translator a chance to translate it to a Python exception translator a chance to translate it to a Python exception