diff --git a/tests/test_embed/test_interpreter.cpp b/tests/test_embed/test_interpreter.cpp index 1d0fbb75b..0dcc9d9c2 100644 --- a/tests/test_embed/test_interpreter.cpp +++ b/tests/test_embed/test_interpreter.cpp @@ -311,7 +311,7 @@ PYBIND11_EMBEDDED_MODULE(test_memory_leak, m) { TEST_CASE("Test that C++ objects are properly deconstructed.") { { auto local = py::dict(); - local['__builtins__'] = py::globals()['__builtins__']; + local["__builtins__"] = py::globals()["__builtins__"]; py::exec(R"( from test_memory_leak import TestObject