From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1851) id 38E353835899; Wed, 14 Dec 2022 10:35:24 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 38E353835899 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1671014124; bh=QPmLslRyEqrdkIr4RxqLkqRVeIxzLbRDL2izWuJYZeI=; h=From:To:Subject:Date:From; b=bwHPP9ERcbv4hqt7gVrBO4SLnceJuAfuJ4t3C3Is/mPP++ASM4NnUrk/vceow8VAp VEMAaOtP8eUQV8hPtu/2qKWhXI72+wSVogvXRzosljorIOJ9LYELdRIOR+IqFPxs3v 6jbwuNF0hnfp7MIPtT6FF56Z4yRZnvIY74995TAs= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Martin Liska To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-4696] mklog: do not depend on recent unidiff version X-Act-Checkin: gcc X-Git-Author: Martin Liska X-Git-Refname: refs/heads/master X-Git-Oldrev: 693638252aae9b36b5b928d7195df6d28bf409d7 X-Git-Newrev: e165214777acfe5621ad36e55b16e098d50e1596 Message-Id: <20221214103524.38E353835899@sourceware.org> Date: Wed, 14 Dec 2022 10:35:24 +0000 (GMT) List-Id: https://gcc.gnu.org/g:e165214777acfe5621ad36e55b16e098d50e1596 commit r13-4696-ge165214777acfe5621ad36e55b16e098d50e1596 Author: Martin Liska Date: Wed Dec 14 11:33:25 2022 +0100 mklog: do not depend on recent unidiff version contrib/ChangeLog: * mklog.py: Check for number of hunks and not if a modified file is binary. Diff: --- contrib/mklog.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/contrib/mklog.py b/contrib/mklog.py index 358b7fc6b8b..5dea8a05c0c 100755 --- a/contrib/mklog.py +++ b/contrib/mklog.py @@ -186,8 +186,9 @@ def generate_changelog(data, no_functions=False, fill_pr_titles=False, # contains commented code which a note that it # has not been tested due to a certain PR or DR. this_file_prs = [] - if not file.is_binary_file: - for line in list(file)[0][0:10]: + hunks = list(file) + if hunks: + for line in hunks[0][0:10]: m = pr_regex.search(line.value) if m: pr = m.group('pr')