Commit ef7a738c by Ralf W. Grosse-Kunstleve Committed by Copybara-Service

Fix Python GIL-not-held issue in pybind11_abseil/register_status_bindings.cc

PiperOrigin-RevId: 481681036
parent 6ef4d699
...@@ -389,7 +389,9 @@ void RegisterStatusBindings(module m) { ...@@ -389,7 +389,9 @@ void RegisterStatusBindings(module m) {
)", )",
m.attr("__dict__"), m.attr("__dict__")); m.attr("__dict__"), m.attr("__dict__"));
static pybind11::object PyStatusNotOk = m.attr("StatusNotOk"); // Intentionally leak this Python reference:
// https://google.github.io/styleguide/cppguide.html#Static_and_Global_Variables
static handle PyStatusNotOk = object(m.attr("StatusNotOk")).release();
// Register a custom handler which converts a C++ StatusNotOk to a // Register a custom handler which converts a C++ StatusNotOk to a
// PyStatusNotOk. // PyStatusNotOk.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment