Commit 9aa816a0 by Michael Chinen Committed by Copybara-Service

Internal change

PiperOrigin-RevId: 439880200
parent 11761446
...@@ -9,12 +9,12 @@ ...@@ -9,12 +9,12 @@
namespace pybind11 { namespace pybind11 {
namespace google { namespace google {
module ImportStatusModule(bool bypass_regular_import) { module_ ImportStatusModule(bool bypass_regular_import) {
if (!PyGILState_Check()) { if (!PyGILState_Check()) {
pybind11_fail("ImportStatusModule() PyGILState_Check() failure."); pybind11_fail("ImportStatusModule() PyGILState_Check() failure.");
} }
if (bypass_regular_import) { if (bypass_regular_import) {
auto m = reinterpret_borrow<module>(PyImport_AddModule( auto m = reinterpret_borrow<module_>(PyImport_AddModule(
PYBIND11_TOSTRING(PYBIND11_ABSEIL_STATUS_MODULE_PATH))); PYBIND11_TOSTRING(PYBIND11_ABSEIL_STATUS_MODULE_PATH)));
if (!internal::IsStatusModuleImported()) { if (!internal::IsStatusModuleImported()) {
internal::RegisterStatusBindings(m); internal::RegisterStatusBindings(m);
...@@ -22,7 +22,7 @@ module ImportStatusModule(bool bypass_regular_import) { ...@@ -22,7 +22,7 @@ module ImportStatusModule(bool bypass_regular_import) {
// else no-op because bindings are already loaded. // else no-op because bindings are already loaded.
return m; return m;
} }
return module::import(PYBIND11_TOSTRING(PYBIND11_ABSEIL_STATUS_MODULE_PATH)); return module_::import(PYBIND11_TOSTRING(PYBIND11_ABSEIL_STATUS_MODULE_PATH));
} }
} // namespace google } // namespace google
......
...@@ -18,7 +18,7 @@ namespace google { ...@@ -18,7 +18,7 @@ namespace google {
// Imports the bindings for the status types. This is meant to only be called // Imports the bindings for the status types. This is meant to only be called
// from a PYBIND11_MODULE definition. The Python GIL must be held when calling // from a PYBIND11_MODULE definition. The Python GIL must be held when calling
// this function (enforced). // this function (enforced).
module ImportStatusModule(bool bypass_regular_import = true); module_ ImportStatusModule(bool bypass_regular_import = true);
} // namespace google } // namespace google
} // namespace pybind11 } // namespace pybind11
......
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