From 0f5cd57f80a704e67b8566f8cf5686d300db28c3 Mon Sep 17 00:00:00 2001 From: htjworld <116538001+htjworld@users.noreply.github.com> Date: Sat, 2 May 2026 12:54:24 +0900 Subject: [PATCH] statistics: Fix geometric_mean() error message for negative inputs (#149246) --- Lib/statistics.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/statistics.py b/Lib/statistics.py index 32fcf2313a81..01ca6c51dafc 100644 --- a/Lib/statistics.py +++ b/Lib/statistics.py @@ -248,7 +248,7 @@ def geometric_mean(data): elif x == 0.0: found_zero = True else: - raise StatisticsError('No negative inputs allowed', x) + raise StatisticsError(f'No negative inputs allowed: {x!r}') total = fsum(map(log, count_positive(data))) -- 2.47.3