From 09d6bf20b67f4d3001afac9d20886a6e9cbcc94f Mon Sep 17 00:00:00 2001 From: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com> Date: Tue, 9 Dec 2025 17:45:52 +0000 Subject: [PATCH] Tachyon: Fix unesecarry plural when there is a single file/sample (#142478) --- Lib/profiling/sampling/heatmap_collector.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Lib/profiling/sampling/heatmap_collector.py b/Lib/profiling/sampling/heatmap_collector.py index e1454f0663a4..f705fbe3a32e 100644 --- a/Lib/profiling/sampling/heatmap_collector.py +++ b/Lib/profiling/sampling/heatmap_collector.py @@ -335,12 +335,14 @@ class _HtmlRenderer: icon = '▶' if is_collapsed else '▼' content_style = ' style="display: none;"' if is_collapsed else '' + file_word = "file" if tree.count == 1 else "files" + sample_word = "sample" if tree.samples == 1 else "samples" section_html = f'''
{icon} {type_names[module_type]} - ({tree.count} files, {tree.samples:,} samples) + ({tree.count} {file_word}, {tree.samples:,} {sample_word})
''' @@ -380,11 +382,14 @@ class _HtmlRenderer: parts = [] # Render folder header (collapsed by default) + file_word = "file" if node.count == 1 else "files" + sample_word = "sample" if node.samples == 1 else "samples" parts.append(f'{indent}