Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions FWCore/PythonFramework/test/PythonTestProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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<std::string>("inputVariable")).c_str()].cast<int>();
outputList_ = main_namespace[(iPS.getParameter<std::string>("outputListVariable")).c_str()].cast<pybind11::list>();

put_ = produces<int>();

usesResource("python");
Expand All @@ -41,9 +40,10 @@ namespace edmtest {
void PythonTestProducer::produce(edm::Event& iEvent, edm::EventSetup const&) {
edm::Handle<IntProduct> 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
Expand Down