From b045179973161115c7ea029b2788f5156fc55cda Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Sun, 11 Dec 2022 17:18:12 +0100 Subject: unidiff: use newline='\n' argument In order to support CR on a line, we need to open files with newline='\n' as our line endings supposed to be of UNIX style. contrib/ChangeLog: * check_GNU_style.py: Use newline=\n. * check_GNU_style_lib.py: Simplify. * gcc-changelog/git_commit.py: Fix issues seen Rust patchset. * gcc-changelog/git_email.py: Use newline argument. * gcc-changelog/test_email.py: New test. * gcc-changelog/test_patches.txt: New test. * mklog.py: Use newline argument. --- contrib/gcc-changelog/git_commit.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'contrib/gcc-changelog/git_commit.py') diff --git a/contrib/gcc-changelog/git_commit.py b/contrib/gcc-changelog/git_commit.py index aae3416..d90e6c1 100755 --- a/contrib/gcc-changelog/git_commit.py +++ b/contrib/gcc-changelog/git_commit.py @@ -718,11 +718,12 @@ class GitCommit: if not prs: # if all ChangeLog entries have identical PRs # then use them - prs = self.changelog_entries[0].prs - for entry in self.changelog_entries: - if entry.prs != prs: - prs = [] - break + if self.changelog_entries: + prs = self.changelog_entries[0].prs + for entry in self.changelog_entries: + if entry.prs != prs: + prs = [] + break entry = ChangeLogEntry(changelog_location, self.top_level_authors, prs) -- cgit v1.1