mirror of https://github.com/python/cpython
Remove redundant if check from optional argument function in argparse. (GH-8766)
This commit is contained in:
parent
1e61504b8b
commit
b9600b0fbd
|
@ -1479,10 +1479,8 @@ class _ActionsContainer(object):
|
|||
|
||||
# strings starting with two prefix characters are long options
|
||||
option_strings.append(option_string)
|
||||
if option_string[0] in self.prefix_chars:
|
||||
if len(option_string) > 1:
|
||||
if option_string[1] in self.prefix_chars:
|
||||
long_option_strings.append(option_string)
|
||||
if len(option_string) > 1 and option_string[1] in self.prefix_chars:
|
||||
long_option_strings.append(option_string)
|
||||
|
||||
# infer destination, '--foo-bar' -> 'foo_bar' and '-x' -> 'x'
|
||||
dest = kwargs.pop('dest', None)
|
||||
|
|
Loading…
Reference in New Issue