Skip to content

Commit

Permalink
fclose
Browse files Browse the repository at this point in the history
  • Loading branch information
oscarhiggott committed Nov 1, 2022
1 parent ab2e510 commit 672980b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/pymatching/sparse_blossom/driver/user_graph.pybind.cc
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,7 @@ void pm_pybind::pybind_user_graph_methods(py::module &m, py::class_<pm::UserGrap
throw std::invalid_argument(msg.str());
}
auto dem = stim::DetectorErrorModel::from_file(file);
fclose(file);
return pm::detector_error_model_to_user_graph(dem);
});
m.def("stim_circuit_file_to_matching_graph", [](const char *stim_circuit_path) {
Expand All @@ -413,6 +414,7 @@ void pm_pybind::pybind_user_graph_methods(py::module &m, py::class_<pm::UserGrap
throw std::invalid_argument(msg.str());
}
auto circuit = stim::Circuit::from_file(file);
fclose(file);
auto dem = stim::ErrorAnalyzer::circuit_to_detector_error_model(circuit, true, true, false, 0, false, false);
return pm::detector_error_model_to_user_graph(dem);
});
Expand Down

0 comments on commit 672980b

Please sign in to comment.