gh-127238: adjust error message for sys.set_int_max_str_digits() (#127241)

Now it's correct and closer to Python/initconfig.c
This commit is contained in:
Sergey B Kirpichev 2024-11-25 08:29:55 +03:00 committed by GitHub
parent 17c16aea66
commit c595eae84c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 1 deletions

View File

@ -0,0 +1 @@
Correct error message for :func:`sys.set_int_max_str_digits`.

View File

@ -4104,7 +4104,7 @@ _PySys_SetIntMaxStrDigits(int maxdigits)
{ {
if (maxdigits != 0 && maxdigits < _PY_LONG_MAX_STR_DIGITS_THRESHOLD) { if (maxdigits != 0 && maxdigits < _PY_LONG_MAX_STR_DIGITS_THRESHOLD) {
PyErr_Format( 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); _PY_LONG_MAX_STR_DIGITS_THRESHOLD);
return -1; return -1;
} }