From aec80e752aad7055f2d4de0bae66736e8707a4d8 Mon Sep 17 00:00:00 2001 From: Sergey B Kirpichev Date: Mon, 25 Nov 2024 05:17:34 +0300 Subject: [PATCH] gh-127238: adjust error message for sys.set_int_max_str_digits() 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 00000000000000..e8a274fcd31f26 --- /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 aaef5aa532412b..6df297f364c5d3 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; }