Skip to content

Commit 276fcb0

Browse files
author
patched.codes[bot]
committed
Patched patchwork/steps/ModifyCode/ModifyCode.py
1 parent 787ded9 commit 276fcb0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

patchwork/steps/ModifyCode/ModifyCode.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
def save_file_contents(file_path, content):
99
"""Utility function to save content to a file."""
10-
with open(file_path, "w") as file:
10+
with open(file_path, "w", newline="") as file:
1111
file.write(content)
1212

1313

@@ -45,7 +45,7 @@ def replace_code_in_file(
4545

4646
if path.exists() and start_line is not None and end_line is not None:
4747
"""Replaces specified lines in a file with new code."""
48-
text = path.read_text()
48+
text = path.read_text(newline="")
4949

5050
lines = text.splitlines(keepends=True)
5151

0 commit comments

Comments
 (0)