From: htjworld <116538001+htjworld@users.noreply.github.com> Date: Sat, 2 May 2026 03:54:24 +0000 (+0900) Subject: statistics: Fix geometric_mean() error message for negative inputs (#149246) X-Git-Tag: v3.15.0b1~126 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0f5cd57f80a704e67b8566f8cf5686d300db28c3;p=thirdparty%2FPython%2Fcpython.git statistics: Fix geometric_mean() error message for negative inputs (#149246) --- 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)))