Skip to content

Commit

Permalink
arghparse: fix compatibility with Python 3.12.7
Browse files Browse the repository at this point in the history
Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
  • Loading branch information
arthurzam committed Oct 2, 2024
1 parent 76e3042 commit 817418d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions NEWS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
Release Notes
=============

snakeoil 0.10.9 (2024-10-02)
----------------------------

- arghparse: fix compatibility with Python 3.12.7 (Arthur Zamarin)

snakeoil 0.10.8 (2024-04-08)
----------------------------

Expand Down
2 changes: 1 addition & 1 deletion src/snakeoil/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
"""

__title__ = "snakeoil"
__version__ = "0.10.8"
__version__ = "0.10.9"
3 changes: 3 additions & 0 deletions src/snakeoil/cli/arghparse.py
Original file line number Diff line number Diff line change
Expand Up @@ -739,6 +739,9 @@ def _parse_optionals(self, arg_strings, namespace):
if option_tuple is None:
pattern = "A"
else:
if len(option_tuple) == 1:
# https://github.com/python/cpython/commit/cbea45ad74779c0ffe760bab7f9d5ce149302495
option_tuple = option_tuple[0]
option_string_indices[i] = option_tuple
pattern = "O"
arg_string_pattern_parts.append(pattern)
Expand Down

0 comments on commit 817418d

Please sign in to comment.