Skip to content

Commit

Permalink
Use os.replace for cross-platform overwriting of the destination
Browse files Browse the repository at this point in the history
Signed-off-by: Laoraid <a99azaz@gmail.com>
  • Loading branch information
laoraid authored Sep 20, 2023
1 parent 3fd8f22 commit 5065415
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pigar/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ def _read_requirement_file(path):
with_banner=True,
with_unknown_imports=False
)
os.rename(tmp_requirement_file, requirement_file)
os.replace(tmp_requirement_file, requirement_file)
finally:
try:
os.remove(tmp_requirement_file)
Expand Down

0 comments on commit 5065415

Please sign in to comment.