]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.12] gh-121018: Fix more cases of exiting in argparse when exit_on_error=False...
authorSerhiy Storchaka <storchaka@gmail.com>
Fri, 28 Jun 2024 14:52:07 +0000 (17:52 +0300)
committerGitHub <noreply@github.com>
Fri, 28 Jun 2024 14:52:07 +0000 (14:52 +0000)
commit8ea6cc14a5178b456278c35f63b0859c6b5f4f64
tree9be053e0efc5a6180ce65acaa006ec7721998251
parent21a63b9c4c16269ea90326968ef0f60ff7f026cf
[3.12] gh-121018: Fix more cases of exiting in argparse when exit_on_error=False (GH-121056) (GH-121129)

* parse_intermixed_args() now raises ArgumentError instead of calling
  error() if exit_on_error is false.
* Internal code now always raises ArgumentError instead of calling
  error(). It is then caught at the higher level and error() is called if
  exit_on_error is true.
(cherry picked from commit 81a654a3425eaa05a51342509089533c1f623f1b)
Lib/argparse.py
Lib/test/test_argparse.py
Misc/NEWS.d/next/Library/2024-06-26-03-04-24.gh-issue-121018.clVSc4.rst