Skip to content

Commit d793d6f

Browse files
Fix Windows debug with python debug (#1991)
Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>
1 parent 2314a61 commit d793d6f

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ if(WIN32)
191191
# Windows debug builds for Python require a d in order for the module to
192192
# load. This also helps ensure that debug builds in general are matched
193193
# to the Microsoft debug CRT.
194-
set(OTIO_DEBUG_POSTFIX "d")
194+
set(OTIO_DEBUG_POSTFIX "_d")
195195
endif()
196196

197197
set_property(GLOBAL PROPERTY USE_FOLDERS ON)

src/py-opentimelineio/opentimelineio-bindings/otio_utils.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,13 @@ void _build_any_to_py_dispatch_table() {
9898
}
9999
}
100100

101-
static py::object _value_to_any = py::none();
101+
// Initialized lazily after the interpreter is ready.
102+
// constructing py::none() at static init time triggers
103+
// pybind11 GIL assertions in Debug builds.
104+
static py::object _value_to_any;
102105

103106
static void py_to_any(py::object const& o, std::any* result) {
104-
if (_value_to_any.is_none()) {
107+
if (!_value_to_any || _value_to_any.is_none()) {
105108
py::object core = py::module::import("opentimelineio.core");
106109
_value_to_any = core.attr("_value_to_any");
107110
}

0 commit comments

Comments
 (0)