diff --git a/c_src/pythonx/pythonx.cpp b/c_src/pythonx/pythonx.cpp index a1477c1..f3d404e 100644 --- a/c_src/pythonx/pythonx.cpp +++ b/c_src/pythonx/pythonx.cpp @@ -104,7 +104,8 @@ class PyGILGuard { ~PyGILGuard() { std::cout << "before PyEval_SaveThread " << this->thread_id << std::endl; - PyEval_SaveThread(); + auto t = PyEval_SaveThread(); + std:: cout << "same state " << (t == thread_states[this->thread_id]) << std::endl; std::cout << "after PyEval_SaveThread " << this->thread_id << std::endl; } };