From: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com> Date: Tue, 9 Dec 2025 17:45:52 +0000 (+0000) Subject: Tachyon: Fix unesecarry plural when there is a single file/sample (#142478) X-Git-Tag: v3.15.0a3~137 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=09d6bf20b67f4d3001afac9d20886a6e9cbcc94f;p=thirdparty%2FPython%2Fcpython.git Tachyon: Fix unesecarry plural when there is a single file/sample (#142478) --- 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}