diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2022-10-04 18:57:34 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-04 18:57:34 (GMT) |
commit | 358b7a4454daf22b0c3b958da6172bf7f3090be3 (patch) | |
tree | 576fead4b2be3c22c31534b5bb8fc652e58470a0 /Lib | |
parent | 938223e8d1eabdd6a73531a8dd52407ef23f6375 (diff) | |
download | cpython-358b7a4454daf22b0c3b958da6172bf7f3090be3.zip cpython-358b7a4454daf22b0c3b958da6172bf7f3090be3.tar.gz cpython-358b7a4454daf22b0c3b958da6172bf7f3090be3.tar.bz2 |
[3.9] gh-96848: Fix -X int_max_str_digits option parsing (GH-96988) (GH-97574)
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')
-rw-r--r-- | Lib/test/test_cmd_line.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/test/test_cmd_line.py b/Lib/test/test_cmd_line.py index e38fc69..9fb48c5 100644 --- a/Lib/test/test_cmd_line.py +++ b/Lib/test/test_cmd_line.py @@ -821,6 +821,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') |