Skip to content

Commit 7f911c1

Browse files
committed
backport cherry pick fix: lookup max from the right place.
1 parent 39837b6 commit 7f911c1

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

Objects/longobject.c

+1-2
Original file line numberDiff line numberDiff line change
@@ -1614,8 +1614,7 @@ long_to_decimal_string_internal(PyObject *aa,
16141614
*/
16151615
if (size_a >= 10 * _PY_LONG_MAX_STR_DIGITS_THRESHOLD
16161616
/ (3 * PyLong_SHIFT) + 2) {
1617-
PyInterpreterState *interp = _PyInterpreterState_GET();
1618-
int max_str_digits = interp->int_max_str_digits;
1617+
int max_str_digits = _PyRuntime.int_max_str_digits;
16191618
if ((max_str_digits > 0) &&
16201619
(max_str_digits / (3 * PyLong_SHIFT) <= (size_a - 11) / 10)) {
16211620
PyErr_Format(PyExc_ValueError, _MAX_STR_DIGITS_ERROR_FMT_TO_STR,

0 commit comments

Comments
 (0)