mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
gh-104860: Fix allow_abbrev=False for single-dash long options (GH-124340)
This commit is contained in:
parent
d08c788822
commit
49e105f948
3 changed files with 20 additions and 1 deletions
|
@ -2328,7 +2328,7 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer):
|
|||
action = self._option_string_actions[option_string]
|
||||
tup = action, option_string, '', short_explicit_arg
|
||||
result.append(tup)
|
||||
elif option_string.startswith(option_prefix):
|
||||
elif self.allow_abbrev and option_string.startswith(option_prefix):
|
||||
action = self._option_string_actions[option_string]
|
||||
tup = action, option_string, None, None
|
||||
result.append(tup)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue