]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-127238: adjust error message for sys.set_int_max_str_digits() (#127241)
authorSergey B Kirpichev <skirpichev@gmail.com>
Mon, 25 Nov 2024 05:29:55 +0000 (08:29 +0300)
committerGitHub <noreply@github.com>
Mon, 25 Nov 2024 05:29:55 +0000 (00:29 -0500)
Now it's correct and closer to Python/initconfig.c

Misc/NEWS.d/next/Core_and_Builtins/2024-11-25-05-15-21.gh-issue-127238.O8wkH-.rst [new file with mode: 0644]
Python/sysmodule.c

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 (file)
index 0000000..e8a274f
--- /dev/null
@@ -0,0 +1 @@
+Correct error message for :func:`sys.set_int_max_str_digits`.
index aaef5aa532412b3fd14d53a1204456f8aeac7641..6df297f364c5d3600151b4458955511e7de945f9 100644 (file)
@@ -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;
     }