From 822b7720e173865c10901c363430c2eeb4671d4e Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Tue, 9 Jan 2024 19:50:21 -0500 Subject: [PATCH] Meta: Let test_pdf.py be less dramatic about issue counts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For every issue string, json['issues'][issue_string] contains a list of (page, count_of_issue_on_this_page) tuples. To get the total number the issue appears in the current document, we need to add up all the count_of_issue_on_this_page, not multiply the page number with count_of_issue_on_this_page and add those (-‸ლ) --- Meta/test_pdf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Meta/test_pdf.py b/Meta/test_pdf.py index 45df83249d..97ec554a49 100755 --- a/Meta/test_pdf.py +++ b/Meta/test_pdf.py @@ -92,7 +92,7 @@ def main(): issue.filenames.append(r.filename) issue.filename_to_issues[r.filename] = j['issues'][diag] issue.num_pages += len(j['issues'][diag]) - issue.count += sum(a * b for (a, b) in j['issues'][diag]) + issue.count += sum(count for (page, count) in j['issues'][diag]) continue if r.returncode == 1: failed_files.append(r.filename)