From 936902901eb8df408a2bc708b327cf7e1325da16 Mon Sep 17 00:00:00 2001 From: Arthur Zamarin Date: Mon, 8 Apr 2024 22:32:45 +0300 Subject: 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 Signed-off-by: Arthur Zamarin --- src/snakeoil/cli/arghparse.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/snakeoil/cli/arghparse.py b/src/snakeoil/cli/arghparse.py index ab458c8..80443b7 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) -- cgit v1.2.3-65-gdbad