aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArthur Zamarin <arthurzam@gentoo.org>2024-04-08 22:32:45 +0300
committerArthur Zamarin <arthurzam@gentoo.org>2024-04-08 22:32:45 +0300
commit936902901eb8df408a2bc708b327cf7e1325da16 (patch)
tree75a39e6940ff153e2ed3c5715798643b558fb7c3
parentstart work on 0.10.8 (diff)
downloadsnakeoil-936902901eb8df408a2bc708b327cf7e1325da16.tar.gz
snakeoil-936902901eb8df408a2bc708b327cf7e1325da16.tar.bz2
snakeoil-936902901eb8df408a2bc708b327cf7e1325da16.zip
arghparse: fix handling with python 3.11.9
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] https://github.com/python/cpython/commit/c02b7ae4dd367444aa6822d5fb73b61e8f5a4ff9 Resolves: https://github.com/pkgcore/pkgcheck/issues/676 Resolves: https://github.com/pkgcore/pkgdev/issues/184 Investigated-by: John Helmert III <ajak@gentoo.org> Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
-rw-r--r--src/snakeoil/cli/arghparse.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/snakeoil/cli/arghparse.py b/src/snakeoil/cli/arghparse.py
index ab458c8f..80443b7a 100644
--- a/src/snakeoil/cli/arghparse.py
+++ b/src/snakeoil/cli/arghparse.py
@@ -774,7 +774,7 @@ class OptionalsParser(argparse.ArgumentParser):
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)