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:43:26 (GMT)
committerPablo Galindo <pablogsal@gmail.com>2022-10-22 19:55:26 (GMT)
commit67f5d24e44cd53f23b814a735718cfca36f553c5 (patch)
tree2c67f4efd092e584c9120a6ab99b569a27b4d4cf /Lib/test/test_cmd_line.py
parent9e008fe3519b6c08edc2f2363bc2eb4a4e044698 (diff)
downloadcpython-67f5d24e44cd53f23b814a735718cfca36f553c5.zip
cpython-67f5d24e44cd53f23b814a735718cfca36f553c5.tar.gz
cpython-67f5d24e44cd53f23b814a735718cfca36f553c5.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 78edd52..1c33be2 100644
--- a/Lib/test/test_cmd_line.py
+++ b/Lib/test/test_cmd_line.py
@@ -874,6 +874,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')