File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ def _write_authors_file(
3434 contents = ""
3535
3636 alias = aliases [0 ] if aliases else name
37- file_content = f"\n { name } ({ alias } ) <{ email } >"
38- if file_content .strip () not in contents :
39- _append_file (file_content , file_path )
37+ candidate = f"{ name } ({ alias } ) <{ email } >"
38+ normalized_lines = [line .strip () for line in contents .splitlines ()]
39+ if candidate not in normalized_lines :
40+ _append_file (f"\n { candidate } " , file_path )
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ def test_write_authors_file(self):
3131 assert email in args [0 ]
3232
3333 # Case: author already present, should not append
34- existing_line = f"\\ n{ name } (alias1) <{ email } >"
34+ existing_line = f"\n { name } (alias1) <{ email } >"
3535 with (
3636 patch (
3737 "edit_python_pe.file_io._read_file" , return_value = existing_line
You can’t perform that action at this time.
0 commit comments