Skip to content

Commit

Permalink
arghparse: fix handling with python 3.11.9
Browse files Browse the repository at this point in the history
In commit [0], the private function changes the tuple size it returns.
By using `*_` in the middle, we can support both extracted versions (3
and 4) of the function.

This investigation was done by ajak, thank you.

[0] python/cpython@c02b7ae

Resolves: pkgcore/pkgcheck#676
Resolves: pkgcore/pkgdev#184
Investigated-by: John Helmert III <ajak@gentoo.org>
Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
  • Loading branch information
arthurzam committed Apr 8, 2024
1 parent 08d7249 commit 9369029
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/snakeoil/cli/arghparse.py
Original file line number Diff line number Diff line change
Expand Up @@ -774,7 +774,7 @@ 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
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 9369029

Please sign in to comment.