From 8b90b1da625f7e96ce9164db55b97a48e039b730 Mon Sep 17 00:00:00 2001 From: Wenzel Jakob Date: Sat, 6 Jul 2019 14:52:32 +0200 Subject: [PATCH] error_already_set: acquire GIL one line earlier (fixes #1779) --- include/pybind11/pybind11.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/pybind11/pybind11.h b/include/pybind11/pybind11.h index 0cc5dd523..68e5757ee 100644 --- a/include/pybind11/pybind11.h +++ b/include/pybind11/pybind11.h @@ -1998,8 +1998,8 @@ class gil_scoped_release { }; error_already_set::~error_already_set() { if (m_type) { - error_scope scope; gil_scoped_acquire gil; + error_scope scope; m_type.release().dec_ref(); m_value.release().dec_ref(); m_trace.release().dec_ref();