Skip to content

Commit

Permalink
fix unclosed resource issue
Browse files Browse the repository at this point in the history
  • Loading branch information
PolarBean committed Sep 8, 2024
1 parent 5eb0e78 commit 324b98a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion CCF_translator/deformation/apply_deformation.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@ def download_deformation_field(url, path):
if not os.path.exists(os.path.dirname(path)):
os.makedirs(os.path.dirname(path))
r = requests.get(url, allow_redirects=True)
open(path, "wb").write(r.content)
with open(path, "wb") as file:
file.write(r.content)


def calculate_offset(original_input_shape, output_shape):
Expand Down

0 comments on commit 324b98a

Please sign in to comment.