Skip to content

Commit 81ae026

Browse files
committed
address review: correct gamma/lgamma error msgs
1 parent d57a640 commit 81ae026

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Lib/test/test_math.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2536,7 +2536,7 @@ def test_exception_messages(self):
25362536
"expected a positive input"):
25372537
math.log(x)
25382538
with self.assertRaisesRegex(ValueError,
2539-
f"expected a float or nonnegative integer, got {x}"):
2539+
f"expected a float or positive integer, got {x}"):
25402540
math.gamma(x)
25412541
x = 1.0
25422542
with self.assertRaisesRegex(ValueError,

Modules/mathmodule.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1232,11 +1232,11 @@ math_floor(PyObject *module, PyObject *number)
12321232
FUNC1AD(gamma, m_tgamma,
12331233
"gamma($module, x, /)\n--\n\n"
12341234
"Gamma function at x.",
1235-
"expected a float or nonnegative integer, got %s")
1235+
"expected a float or positive integer, got %s")
12361236
FUNC1AD(lgamma, m_lgamma,
12371237
"lgamma($module, x, /)\n--\n\n"
12381238
"Natural logarithm of absolute value of Gamma function at x.",
1239-
"expected a float or nonnegative integer, got %s")
1239+
"expected a float or positive integer, got %s")
12401240
FUNC1D(log1p, m_log1p, 0,
12411241
"log1p($module, x, /)\n--\n\n"
12421242
"Return the natural logarithm of 1+x (base e).\n\n"

0 commit comments

Comments
 (0)