Skip to content

Commit

Permalink
try explicitely close the file
Browse files Browse the repository at this point in the history
  • Loading branch information
olivierlabayle committed Nov 17, 2023
1 parent 23d5393 commit 5399c12
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ext/JSONExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ Writes a `Configuration` struct to a YAML file. The latter can be deserialized
with `configuration_from_yaml`.
"""
function TMLE.configuration_to_json(file, config; indent=1)
open(file, "w") do io
JSON.print(io, to_dict(config), indent)
end
io = open(file, "w")
JSON.print(io, to_dict(config), indent)
close(io)
end

end

0 comments on commit 5399c12

Please sign in to comment.