]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-39716: Raise on conflicting subparser names. (GH-18605)
authorAntony Lee <anntzer.lee@gmail.com>
Sun, 1 May 2022 06:04:50 +0000 (08:04 +0200)
committerGitHub <noreply@github.com>
Sun, 1 May 2022 06:04:50 +0000 (23:04 -0700)
commitad5e8520f3e117f45481513014548a39879d30d2
treee967814e58ce8cd84ad3debc8f6ff91781991ef8
parent9588f880a286a8cc5597188f6ab44108c8f18761
bpo-39716: Raise on conflicting subparser names. (GH-18605)

Raise an ArgumentError when the same subparser name is added twice to an
ArgumentParser.  This is consistent with the (default) behavior when the
same option string is added twice to an ArgumentParser.

(Support for `conflict_handler="resolve"` could be considered as a
followup feature, although real use cases seem even rarer than
"resolve"ing option-strings.)

Automerge-Triggered-By: GH:rhettinger
Lib/argparse.py
Lib/test/test_argparse.py
Misc/NEWS.d/next/Library/2020-02-22-12-02-11.bpo-39716.z2WhDQ.rst [new file with mode: 0644]