diff options
author | Gregory P. Smith <greg@krypto.org> | 2022-10-03 20:55:45 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-03 20:55:45 (GMT) |
commit | b0f89cb4311b696f875e58f14258ce315be09bce (patch) | |
tree | c387a1482f5b7c1a12061cf0f755835cf95a6a71 /Lib/test/test_embed.py | |
parent | cfbc7dd91059cb663c7fe13c661665943495ed7f (diff) | |
download | cpython-b0f89cb4311b696f875e58f14258ce315be09bce.zip cpython-b0f89cb4311b696f875e58f14258ce315be09bce.tar.gz cpython-b0f89cb4311b696f875e58f14258ce315be09bce.tar.bz2 |
gh-96512: Move int_max_str_digits setting to PyConfig (#96944)
It had to live as a global outside of PyConfig for stable ABI reasons in
the pre-3.12 backports.
This removes the `_Py_global_config_int_max_str_digits` and gets rid of
the equivalent field in the internal `struct _is PyInterpreterState` as
code can just use the existing nested config struct within that.
Adds tests to verify unique settings and configs in subinterpreters.
Diffstat (limited to 'Lib/test/test_embed.py')
-rw-r--r-- | Lib/test/test_embed.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/test_embed.py b/Lib/test/test_embed.py index 6b5d485..c5aeb94 100644 --- a/Lib/test/test_embed.py +++ b/Lib/test/test_embed.py @@ -434,6 +434,7 @@ class InitConfigTests(EmbeddingTestsMixin, unittest.TestCase): 'install_signal_handlers': 1, 'use_hash_seed': 0, 'hash_seed': 0, + 'int_max_str_digits': sys.int_info.default_max_str_digits, 'faulthandler': 0, 'tracemalloc': 0, 'perf_profiling': 0, @@ -876,6 +877,7 @@ class InitConfigTests(EmbeddingTestsMixin, unittest.TestCase): 'platlibdir': 'my_platlibdir', 'module_search_paths': self.IGNORE_CONFIG, 'safe_path': 1, + 'int_max_str_digits': 31337, 'check_hash_pycs_mode': 'always', 'pathconfig_warnings': 0, @@ -912,6 +914,7 @@ class InitConfigTests(EmbeddingTestsMixin, unittest.TestCase): 'platlibdir': 'env_platlibdir', 'module_search_paths': self.IGNORE_CONFIG, 'safe_path': 1, + 'int_max_str_digits': 4567, } self.check_all_configs("test_init_compat_env", config, preconfig, api=API_COMPAT) @@ -944,6 +947,7 @@ class InitConfigTests(EmbeddingTestsMixin, unittest.TestCase): 'platlibdir': 'env_platlibdir', 'module_search_paths': self.IGNORE_CONFIG, 'safe_path': 1, + 'int_max_str_digits': 4567, } self.check_all_configs("test_init_python_env", config, preconfig, api=API_PYTHON) |