Skip to content

Commit

Permalink
Preserve compatibility with argparse option tuples of length 4
Browse files Browse the repository at this point in the history
  • Loading branch information
kislyuk committed Apr 14, 2024
1 parent 057faff commit 54a4846
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion argcomplete/packages/_argparse.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,10 @@ def take_action(action, argument_strings, option_string=None):
def consume_optional(start_index):
# get the optional identified at this index
option_tuple = option_string_indices[start_index]
action, option_string, explicit_arg = option_tuple
if len(option_tuple) == 3:
action, option_string, explicit_arg = option_tuple
else: # Python 3.11.9+, 3.12.3+, 3.13+
action, option_string, _, explicit_arg = option_tuple

# identify additional optionals in the same arg string
# (e.g. -xyz is the same as -x -y -z if no args are required)
Expand Down

0 comments on commit 54a4846

Please sign in to comment.