diff options
author | Eric Snow <ericsnowcurrently@gmail.com> | 2022-10-19 20:27:46 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-19 20:27:46 (GMT) |
commit | 9c8dde0fa5309ae9f83a4faa07f062fcd84df4cf (patch) | |
tree | 16f0ebdbd2b3c82e8c84af9a94e13b0e2fb1ba5d /Objects | |
parent | 52fcba651288ac1c0f9b1fb71379f1dad54ee1da (diff) | |
download | cpython-9c8dde0fa5309ae9f83a4faa07f062fcd84df4cf.zip cpython-9c8dde0fa5309ae9f83a4faa07f062fcd84df4cf.tar.gz cpython-9c8dde0fa5309ae9f83a4faa07f062fcd84df4cf.tar.bz2 |
gh-98417: Store int_max_str_digits on the Interpreter State (GH-98418)
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/longobject.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Objects/longobject.c b/Objects/longobject.c index 8b13df4..304fabf 100644 --- a/Objects/longobject.c +++ b/Objects/longobject.c @@ -1767,7 +1767,7 @@ long_to_decimal_string_internal(PyObject *aa, if (size_a >= 10 * _PY_LONG_MAX_STR_DIGITS_THRESHOLD / (3 * PyLong_SHIFT) + 2) { PyInterpreterState *interp = _PyInterpreterState_GET(); - int max_str_digits = interp->config.int_max_str_digits; + int max_str_digits = interp->long_state.max_str_digits; if ((max_str_digits > 0) && (max_str_digits / (3 * PyLong_SHIFT) <= (size_a - 11) / 10)) { PyErr_Format(PyExc_ValueError, _MAX_STR_DIGITS_ERROR_FMT_TO_STR, @@ -1837,7 +1837,7 @@ long_to_decimal_string_internal(PyObject *aa, } if (strlen > _PY_LONG_MAX_STR_DIGITS_THRESHOLD) { PyInterpreterState *interp = _PyInterpreterState_GET(); - int max_str_digits = interp->config.int_max_str_digits; + int max_str_digits = interp->long_state.max_str_digits; Py_ssize_t strlen_nosign = strlen - negative; if ((max_str_digits > 0) && (strlen_nosign > max_str_digits)) { Py_DECREF(scratch); @@ -2578,7 +2578,7 @@ long_from_string_base(const char **str, int base, PyLongObject **res) * quadratic algorithm. */ if (digits > _PY_LONG_MAX_STR_DIGITS_THRESHOLD) { PyInterpreterState *interp = _PyInterpreterState_GET(); - int max_str_digits = interp->config.int_max_str_digits; + int max_str_digits = interp->long_state.max_str_digits; if ((max_str_digits > 0) && (digits > max_str_digits)) { PyErr_Format(PyExc_ValueError, _MAX_STR_DIGITS_ERROR_FMT_TO_INT, max_str_digits, digits); |