Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
b9600b0f
Commit
b9600b0f
authored
Jun 21, 2019
by
Shashank Parekh
Committed by
Benjamin Peterson
Jun 20, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove redundant if check from optional argument function in argparse. (GH-8766)
parent
1e61504b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
4 deletions
+2
-4
Lib/argparse.py
Lib/argparse.py
+2
-4
No files found.
Lib/argparse.py
View file @
b9600b0f
...
...
@@ -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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment