diff --git a/FWCore/PythonFramework/test/PythonTestProducer.cc b/FWCore/PythonFramework/test/PythonTestProducer.cc index c38702cce8a92..a9a83a369adec 100644 --- a/FWCore/PythonFramework/test/PythonTestProducer.cc +++ b/FWCore/PythonFramework/test/PythonTestProducer.cc @@ -32,7 +32,6 @@ namespace edmtest { //NOTE attempts to hold the object directly and read it in `produce` lead to segmentation faults value_ = main_namespace[(iPS.getParameter("inputVariable")).c_str()].cast(); outputList_ = main_namespace[(iPS.getParameter("outputListVariable")).c_str()].cast(); - put_ = produces(); usesResource("python"); @@ -41,9 +40,10 @@ namespace edmtest { void PythonTestProducer::produce(edm::Event& iEvent, edm::EventSetup const&) { edm::Handle h; iEvent.getByToken(get_, h); - - outputList_.append(h->value); - + { + pybind11::gil_scoped_acquire acquire; + outputList_.append(h->value); + } iEvent.emplace(put_, h->value + value_); } } // namespace edmtest