summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_cmd_line.py
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2022-09-26 15:46:04 (GMT)
committerGitHub <noreply@github.com>2022-09-26 15:46:04 (GMT)
commit00c352404a2f57f16a0b0d02eef5bdf1a1bd169f (patch)
tree316654758720062bba56bef086bb13dc100dfa22 /Lib/test/test_cmd_line.py
parent8bdaf9bf8e39b2ea374ee01a36b3c1bdaed01b23 (diff)
downloadcpython-00c352404a2f57f16a0b0d02eef5bdf1a1bd169f.zip
cpython-00c352404a2f57f16a0b0d02eef5bdf1a1bd169f.tar.gz
cpython-00c352404a2f57f16a0b0d02eef5bdf1a1bd169f.tar.bz2
gh-96848: Fix -X int_max_str_digits option parsing (GH-96988)
Fix command line parsing: reject "-X int_max_str_digits" option with no value (invalid) when the PYTHONINTMAXSTRDIGITS environment variable is set to a valid limit. (cherry picked from commit 41351662bcd21672d8ccfa62fe44d72027e6bcf8) Co-authored-by: Victor Stinner <vstinner@python.org>
Diffstat (limited to 'Lib/test/test_cmd_line.py')
-rw-r--r--Lib/test/test_cmd_line.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/test/test_cmd_line.py b/Lib/test/test_cmd_line.py
index 84bd883..14de3d4 100644
--- a/Lib/test/test_cmd_line.py
+++ b/Lib/test/test_cmd_line.py
@@ -831,6 +831,8 @@ class CmdLineTest(unittest.TestCase):
assert_python_failure('-X', 'int_max_str_digits', '-c', code)
assert_python_failure('-X', 'int_max_str_digits=foo', '-c', code)
assert_python_failure('-X', 'int_max_str_digits=100', '-c', code)
+ assert_python_failure('-X', 'int_max_str_digits', '-c', code,
+ PYTHONINTMAXSTRDIGITS='4000')
assert_python_failure('-c', code, PYTHONINTMAXSTRDIGITS='foo')
assert_python_failure('-c', code, PYTHONINTMAXSTRDIGITS='100')