From c595eae84c7f665eced09ce67a1ad83b7574d6e5 Mon Sep 17 00:00:00 2001 From: Sergey B Kirpichev Date: Mon, 25 Nov 2024 08:29:55 +0300 Subject: [PATCH] gh-127238: adjust error message for sys.set_int_max_str_digits() (#127241) Now it's correct and closer to Python/initconfig.c --- .../2024-11-25-05-15-21.gh-issue-127238.O8wkH-.rst | 1 + Python/sysmodule.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 Misc/NEWS.d/next/Core_and_Builtins/2024-11-25-05-15-21.gh-issue-127238.O8wkH-.rst 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; }