diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2024-02-05 20:42:43 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-05 20:42:43 (GMT) |
commit | 4aa4f0906df9fc9c6c6f6657f2c521468c6b1688 (patch) | |
tree | 7981fa18e770c7ce82517eec79b3944ce5a84d4e /Lib/argparse.py | |
parent | 750489cc774df44daa2c0d23e8a404fe62be93d1 (diff) | |
download | cpython-4aa4f0906df9fc9c6c6f6657f2c521468c6b1688.zip cpython-4aa4f0906df9fc9c6c6f6657f2c521468c6b1688.tar.gz cpython-4aa4f0906df9fc9c6c6f6657f2c521468c6b1688.tar.bz2 |
gh-109475: Fix support of explicit option value "--" in argparse (GH-114814)
For example "--option=--".
Diffstat (limited to 'Lib/argparse.py')
-rw-r--r-- | Lib/argparse.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/argparse.py b/Lib/argparse.py index 9e19f39..2131d72 100644 --- a/Lib/argparse.py +++ b/Lib/argparse.py @@ -2485,7 +2485,7 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer): # ======================== def _get_values(self, action, arg_strings): # for everything but PARSER, REMAINDER args, strip out first '--' - if action.nargs not in [PARSER, REMAINDER]: + if not action.option_strings and action.nargs not in [PARSER, REMAINDER]: try: arg_strings.remove('--') except ValueError: |