diff options
author | Victor Stinner <vstinner@python.org> | 2022-09-16 18:04:37 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-16 18:04:37 (GMT) |
commit | e841ffc915e82e5ea6e3b473205417d63494808d (patch) | |
tree | a7e63fa84836f4d41ce47b01658e5e5e591dd24c /Objects | |
parent | 426d72e7ddb0af5cf851914ac75127186dd1ff04 (diff) | |
download | cpython-e841ffc915e82e5ea6e3b473205417d63494808d.zip cpython-e841ffc915e82e5ea6e3b473205417d63494808d.tar.gz cpython-e841ffc915e82e5ea6e3b473205417d63494808d.tar.bz2 |
gh-95778: Mention sys.set_int_max_str_digits() in error message (#96874)
When ValueError is raised if an integer is larger than the limit,
mention sys.set_int_max_str_digits() in the error message.
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/longobject.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Objects/longobject.c b/Objects/longobject.c index cb52f82..c0bade1 100644 --- a/Objects/longobject.c +++ b/Objects/longobject.c @@ -36,8 +36,8 @@ medium_value(PyLongObject *x) #define IS_SMALL_INT(ival) (-_PY_NSMALLNEGINTS <= (ival) && (ival) < _PY_NSMALLPOSINTS) #define IS_SMALL_UINT(ival) ((ival) < _PY_NSMALLPOSINTS) -#define _MAX_STR_DIGITS_ERROR_FMT_TO_INT "Exceeds the limit (%d) for integer string conversion: value has %zd digits" -#define _MAX_STR_DIGITS_ERROR_FMT_TO_STR "Exceeds the limit (%d) for integer string conversion" +#define _MAX_STR_DIGITS_ERROR_FMT_TO_INT "Exceeds the limit (%d) for integer string conversion: value has %zd digits; use sys.set_int_max_str_digits() to increase the limit" +#define _MAX_STR_DIGITS_ERROR_FMT_TO_STR "Exceeds the limit (%d) for integer string conversion; use sys.set_int_max_str_digits() to increase the limit" static inline void _Py_DECREF_INT(PyLongObject *op) |