From: Sergey B Kirpichev Date: Mon, 25 Nov 2024 05:29:55 +0000 (+0300) Subject: gh-127238: adjust error message for sys.set_int_max_str_digits() (#127241) X-Git-Tag: v3.14.0a3~216 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c595eae84c7f665eced09ce67a1ad83b7574d6e5;p=thirdparty%2FPython%2Fcpython.git gh-127238: adjust error message for sys.set_int_max_str_digits() (#127241) Now it's correct and closer to Python/initconfig.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 index 000000000000..e8a274fcd31f --- /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 aaef5aa53241..6df297f364c5 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; }