diff --git a/include/pybind11/pybind11.h b/include/pybind11/pybind11.h index e2ddda02..96f3ff80 100644 --- a/include/pybind11/pybind11.h +++ b/include/pybind11/pybind11.h @@ -2089,15 +2089,7 @@ public: } if (release) { - /* Work around an annoying assertion in PyThreadState_Swap */ - #if defined(Py_DEBUG) - PyInterpreterState *interp = tstate->interp; - tstate->interp = nullptr; - #endif PyEval_AcquireThread(tstate); - #if defined(Py_DEBUG) - tstate->interp = interp; - #endif } inc_ref();