Skip to content

Commit e5e54e9

Browse files
authored
Update diffapply.py
1 parent 45a6389 commit e5e54e9

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎python_agent_harness/tools/diffapply.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def old_seq(self) -> list[tuple[str, str]]:
4848
"""(kind, content-without-newline) for the lines that must exist
4949
in the old file (' ' context and '-' removed lines)."""
5050
return [
51-
(kind, content.rstrip("\n")) for kind, content, _ in self.body if kind in (" ", "-")
51+
(kind, content.rstrip("\r\n")) for kind, content, _ in self.body if kind in (" ", "-")
5252
]
5353

5454

@@ -142,7 +142,7 @@ def _match_hunk(hunk: _Hunk, file_lines: list[str]) -> int | None:
142142
mismatches = 0
143143
ok = True
144144
for i, (kind, content) in enumerate(old_seq):
145-
file_content = file_lines[p + i].rstrip("\n")
145+
file_content = file_lines[p + i].rstrip("\r\n")
146146
if kind == "-":
147147
if file_content != content:
148148
ok = False

0 commit comments

Comments
 (0)