Skip to content

Commit

Permalink
Use context manager for opening temporary file
Browse files Browse the repository at this point in the history
  • Loading branch information
153957 committed Dec 17, 2024
1 parent d9ef239 commit 42ba4bb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions publicdb/histograms/esd.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,9 +242,9 @@ def create_temporary_file():
it for writing
"""
f = tempfile.NamedTemporaryFile(delete=False)
f.close()
return f.name
with tempfile.NamedTemporaryFile(delete=False) as file:
pass
return file.name


def copy_temporary_esd_node_to_esd(summary, file_path, node_path):
Expand Down

0 comments on commit 42ba4bb

Please sign in to comment.