diff --git a/CMakeLists.txt b/CMakeLists.txt index 828ef238e..1d2b233ef 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -191,7 +191,7 @@ if(WIN32) # Windows debug builds for Python require a d in order for the module to # load. This also helps ensure that debug builds in general are matched # to the Microsoft debug CRT. - set(OTIO_DEBUG_POSTFIX "d") + set(OTIO_DEBUG_POSTFIX "_d") endif() set_property(GLOBAL PROPERTY USE_FOLDERS ON) diff --git a/src/py-opentimelineio/opentimelineio-bindings/otio_utils.cpp b/src/py-opentimelineio/opentimelineio-bindings/otio_utils.cpp index 0403461e1..eaa74fc9f 100644 --- a/src/py-opentimelineio/opentimelineio-bindings/otio_utils.cpp +++ b/src/py-opentimelineio/opentimelineio-bindings/otio_utils.cpp @@ -98,10 +98,13 @@ void _build_any_to_py_dispatch_table() { } } -static py::object _value_to_any = py::none(); +// Initialized lazily after the interpreter is ready. +// constructing py::none() at static init time triggers +// pybind11 GIL assertions in Debug builds. +static py::object _value_to_any; static void py_to_any(py::object const& o, std::any* result) { - if (_value_to_any.is_none()) { + if (!_value_to_any || _value_to_any.is_none()) { py::object core = py::module::import("opentimelineio.core"); _value_to_any = core.attr("_value_to_any"); }