summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_cmd_line.py
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2022-09-26 15:20:08 (GMT)
committerGitHub <noreply@github.com>2022-09-26 15:20:08 (GMT)
commit41351662bcd21672d8ccfa62fe44d72027e6bcf8 (patch)
tree97bede41a5c3871f7601794079311892137613c9 /Lib/test/test_cmd_line.py
parent2b428a1faed88f148ede131e3b86ab6227c6c3f0 (diff)
downloadcpython-41351662bcd21672d8ccfa62fe44d72027e6bcf8.zip
cpython-41351662bcd21672d8ccfa62fe44d72027e6bcf8.tar.gz
cpython-41351662bcd21672d8ccfa62fe44d72027e6bcf8.tar.bz2
gh-96848: Fix -X int_max_str_digits option parsing (#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.
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 db96708..3de8c3d 100644
--- a/Lib/test/test_cmd_line.py
+++ b/Lib/test/test_cmd_line.py
@@ -871,6 +871,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')