summaryrefslogtreecommitdiff
path: root/Programs/_testembed.c
diff options
context:
space:
mode:
authorGregory P. Smith <greg@krypto.org>2022-10-03 13:55:45 -0700
committerGitHub <noreply@github.com>2022-10-03 13:55:45 -0700
commitb0f89cb4311b696f875e58f14258ce315be09bce (patch)
treec387a1482f5b7c1a12061cf0f755835cf95a6a71 /Programs/_testembed.c
parentcfbc7dd91059cb663c7fe13c661665943495ed7f (diff)
downloadcpython-git-b0f89cb4311b696f875e58f14258ce315be09bce.tar.gz
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 'Programs/_testembed.c')
-rw-r--r--Programs/_testembed.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/Programs/_testembed.c b/Programs/_testembed.c
index e5b138ce84..d635c5a4ab 100644
--- a/Programs/_testembed.c
+++ b/Programs/_testembed.c
@@ -683,6 +683,9 @@ static int test_init_from_config(void)
config._isolated_interpreter = 1;
+ putenv("PYTHONINTMAXSTRDIGITS=6666");
+ config.int_max_str_digits = 31337;
+
init_from_config_clear(&config);
dump_config();
@@ -748,6 +751,7 @@ static void set_most_env_vars(void)
putenv("PYTHONIOENCODING=iso8859-1:replace");
putenv("PYTHONPLATLIBDIR=env_platlibdir");
putenv("PYTHONSAFEPATH=1");
+ putenv("PYTHONINTMAXSTRDIGITS=4567");
}