summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_cmd_line.py
diff options
context:
space:
mode:
authorGregory P. Smith <greg@krypto.org>2022-10-03 20:55:45 (GMT)
committerGitHub <noreply@github.com>2022-10-03 20:55:45 (GMT)
commitb0f89cb4311b696f875e58f14258ce315be09bce (patch)
treec387a1482f5b7c1a12061cf0f755835cf95a6a71 /Lib/test/test_cmd_line.py
parentcfbc7dd91059cb663c7fe13c661665943495ed7f (diff)
downloadcpython-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_cmd_line.py')
-rw-r--r--Lib/test/test_cmd_line.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/test/test_cmd_line.py b/Lib/test/test_cmd_line.py
index 3de8c3d..9429800 100644
--- a/Lib/test/test_cmd_line.py
+++ b/Lib/test/test_cmd_line.py
@@ -882,7 +882,8 @@ class CmdLineTest(unittest.TestCase):
return tuple(int(i) for i in out.split())
res = assert_python_ok('-c', code)
- self.assertEqual(res2int(res), (-1, sys.get_int_max_str_digits()))
+ current_max = sys.get_int_max_str_digits()
+ self.assertEqual(res2int(res), (current_max, current_max))
res = assert_python_ok('-X', 'int_max_str_digits=0', '-c', code)
self.assertEqual(res2int(res), (0, 0))
res = assert_python_ok('-X', 'int_max_str_digits=4000', '-c', code)