Skip to content

Commit

Permalink
Fix a new refurb issue
Browse files Browse the repository at this point in the history
  • Loading branch information
nth10sd committed Dec 26, 2023
1 parent c401985 commit 8d615fc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion python/rustpy01/truncate.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def py_truncate_file_lines(filename: Path | str, lines_wanted: int) -> None:
g.write(line)

target_file = temp_file.with_suffix("").with_suffix(
f'{Path(filename).suffix.removesuffix("~")}'
str(Path(filename).suffix.removesuffix("~"))
)
# Needs to be opened in binary mode or else Windows uses CRLF instead of LF
with temp_file.open("rb") as f, target_file.open("wb") as g:
Expand Down

0 comments on commit 8d615fc

Please sign in to comment.