]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.13] gh-121018: Fix more cases of exiting in argparse when exit_on_error=False...
authorSerhiy Storchaka <storchaka@gmail.com>
Fri, 28 Jun 2024 15:04:44 +0000 (18:04 +0300)
committerGitHub <noreply@github.com>
Fri, 28 Jun 2024 15:04:44 +0000 (15:04 +0000)
commit99de20d729c14c9ea062c205b55925305ed797b6
treecbb1a9161c46fac0746601f673a086ae0a5dfadb
parent394dc93bf99d01f085b6a76ba057b1941cc2ebc7
[3.13] gh-121018: Fix more cases of exiting in argparse when exit_on_error=False (GH-121056) (GH-121128)

* 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 [new file with mode: 0644]