Skip to content

Commit

Permalink
🐛 ensure fixed file is closed before moving it
Browse files Browse the repository at this point in the history
  • Loading branch information
Mathieu committed Mar 16, 2024
1 parent 6adf10d commit a986445
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pip_audit/_dependency_source/pyproject.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,8 @@ def fix(self, fix_version: ResolvedFixVersion) -> None:
# Now dump the new edited TOML to the temporary file.
toml.dump(pyproject_data, tmp)

# And replace the original `pyproject.toml` file.
os.replace(tmp.name, self.filename)
# And replace the original `pyproject.toml` file.
os.replace(tmp.name, self.filename)


class PyProjectSourceError(DependencySourceError):
Expand Down

0 comments on commit a986445

Please sign in to comment.