@@ -791,10 +791,12 @@ _PyConfig_InitCompatConfig(PyConfig *config)
791
791
config -> safe_path = 0 ;
792
792
config -> _is_python_build = 0 ;
793
793
config -> code_debug_ranges = 1 ;
794
- /* config_init_int_max_str_digits() sets default limit */
795
- config -> int_max_str_digits = -1 ;
796
794
}
797
795
796
+ /* Excluded from public struct PyConfig for backporting reasons. */
797
+ /* default to unconfigured, _PyLong_InitTypes() does the rest */
798
+ int _Py_global_config_int_max_str_digits = -1 ;
799
+
798
800
799
801
static void
800
802
config_init_defaults (PyConfig * config )
@@ -1019,7 +1021,6 @@ _PyConfig_Copy(PyConfig *config, const PyConfig *config2)
1019
1021
COPY_ATTR (safe_path );
1020
1022
COPY_WSTRLIST (orig_argv );
1021
1023
COPY_ATTR (_is_python_build );
1022
- COPY_ATTR (int_max_str_digits );
1023
1024
1024
1025
#undef COPY_ATTR
1025
1026
#undef COPY_WSTR_ATTR
@@ -1127,7 +1128,6 @@ _PyConfig_AsDict(const PyConfig *config)
1127
1128
SET_ITEM_INT (use_frozen_modules );
1128
1129
SET_ITEM_INT (safe_path );
1129
1130
SET_ITEM_INT (_is_python_build );
1130
- SET_ITEM_INT (int_max_str_digits );
1131
1131
1132
1132
return dict ;
1133
1133
@@ -1781,9 +1781,6 @@ config_init_int_max_str_digits(PyConfig *config)
1781
1781
int maxdigits ;
1782
1782
int valid = 0 ;
1783
1783
1784
- /* default to unconfigured, _PyLong_InitTypes() does the rest */
1785
- config -> int_max_str_digits = -1 ;
1786
-
1787
1784
const char * env = config_get_env (config , "PYTHONINTMAXSTRDIGITS" );
1788
1785
if (env ) {
1789
1786
if (!_Py_str_to_int (env , & maxdigits )) {
@@ -1797,7 +1794,7 @@ config_init_int_max_str_digits(PyConfig *config)
1797
1794
STRINGIFY (_PY_LONG_MAX_STR_DIGITS_THRESHOLD )
1798
1795
" or 0 for unlimited." );
1799
1796
}
1800
- config -> int_max_str_digits = maxdigits ;
1797
+ _Py_global_config_int_max_str_digits = maxdigits ;
1801
1798
}
1802
1799
1803
1800
const wchar_t * xoption = config_get_xoption (config , L"int_max_str_digits" );
@@ -1816,7 +1813,7 @@ config_init_int_max_str_digits(PyConfig *config)
1816
1813
#undef _STRINGIFY
1817
1814
#undef STRINGIFY
1818
1815
}
1819
- config -> int_max_str_digits = maxdigits ;
1816
+ _Py_global_config_int_max_str_digits = maxdigits ;
1820
1817
}
1821
1818
return _PyStatus_OK ();
1822
1819
}
@@ -1884,7 +1881,7 @@ config_read_complex_options(PyConfig *config)
1884
1881
}
1885
1882
}
1886
1883
1887
- if (config -> int_max_str_digits < 0 ) {
1884
+ if (_Py_global_config_int_max_str_digits < 0 ) {
1888
1885
status = config_init_int_max_str_digits (config );
1889
1886
if (_PyStatus_EXCEPTION (status )) {
1890
1887
return status ;
0 commit comments