]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-121018: Fix more cases of exiting in argparse when exit_on_error=False (GH-121056)
authorSerhiy Storchaka <storchaka@gmail.com>
Fri, 28 Jun 2024 14:21:59 +0000 (17:21 +0300)
committerGitHub <noreply@github.com>
Fri, 28 Jun 2024 14:21:59 +0000 (17:21 +0300)
commit81a654a3425eaa05a51342509089533c1f623f1b
treec7ff9702b67797c491daa04030e7c409edaaa509
parent43709d5d5424725ec061de2c12c3761affde69ef
gh-121018: Fix more cases of exiting in argparse when exit_on_error=False (GH-121056)

* 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.
Lib/argparse.py
Lib/test/test_argparse.py
Misc/NEWS.d/next/Library/2024-06-26-03-04-24.gh-issue-121018.clVSc4.rst