File tree Expand file tree Collapse file tree 1 file changed +0
-22
lines changed Expand file tree Collapse file tree 1 file changed +0
-22
lines changed Original file line number Diff line number Diff line change @@ -280,28 +280,6 @@ inline subinterpreter_scoped_activate::~subinterpreter_scoped_activate() {
280
280
// We were on this interpreter already, so just make sure the GIL goes back as it was
281
281
PyGILState_Release (gil_state_);
282
282
} else {
283
- #if defined(PYBIND11_DETAILED_ERROR_MESSAGES)
284
- bool has_active_exception;
285
- # if defined(__cpp_lib_uncaught_exceptions)
286
- has_active_exception = std::uncaught_exceptions () > 0 ;
287
- # else
288
- // removed in C++20, replaced with uncaught_exceptions
289
- has_active_exception = std::uncaught_exception ();
290
- # endif
291
- if (has_active_exception) {
292
- try {
293
- std::rethrow_exception (std::current_exception ());
294
- } catch (error_already_set &) {
295
- // Because error_already_set holds python objects and what() acquires the GIL, it
296
- // is basically never OK to let these exceptions propagate outside the current
297
- // active interpreter.
298
- pybind11_fail (" ~subinterpreter_scoped_activate: cannot propagate Python "
299
- " exceptions outside of their owning interpreter" );
300
- } catch (...) {
301
- }
302
- }
303
- #endif
304
-
305
283
if (tstate_) {
306
284
#if defined(PYBIND11_DETAILED_ERROR_MESSAGES)
307
285
if (detail::get_thread_state_unchecked () != tstate_) {
You can’t perform that action at this time.
0 commit comments