aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--Misc/NEWS.d/next/Core_and_Builtins/2024-11-25-05-15-21.gh-issue-127238.O8wkH-.rst1
-rw-r--r--Python/sysmodule.c2
2 files changed, 2 insertions, 1 deletions
diff --git a/Misc/NEWS.d/next/Core_and_Builtins/2024-11-25-05-15-21.gh-issue-127238.O8wkH-.rst b/Misc/NEWS.d/next/Core_and_Builtins/2024-11-25-05-15-21.gh-issue-127238.O8wkH-.rst
new file mode 100644
index 00000000000..e8a274fcd31
--- /dev/null
+++ b/Misc/NEWS.d/next/Core_and_Builtins/2024-11-25-05-15-21.gh-issue-127238.O8wkH-.rst
@@ -0,0 +1 @@
+Correct error message for :func:`sys.set_int_max_str_digits`.
diff --git a/Python/sysmodule.c b/Python/sysmodule.c
index aaef5aa5324..6df297f364c 100644
--- a/Python/sysmodule.c
+++ b/Python/sysmodule.c
@@ -4104,7 +4104,7 @@ _PySys_SetIntMaxStrDigits(int maxdigits)
{
if (maxdigits != 0 && maxdigits < _PY_LONG_MAX_STR_DIGITS_THRESHOLD) {
PyErr_Format(
- PyExc_ValueError, "maxdigits must be 0 or larger than %d",
+ PyExc_ValueError, "maxdigits must be >= %d or 0 for unlimited",
_PY_LONG_MAX_STR_DIGITS_THRESHOLD);
return -1;
}