Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
hamdanal committed Oct 21, 2023
1 parent 77f5324 commit 1fc52ce
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion rich_argparse/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,10 @@ def find_span(_string: str) -> tuple[int, int]:
elif action.nargs in (None, argparse.OPTIONAL, argparse.PARSER):
nargs = 1
elif action.nargs == argparse.ZERO_OR_MORE:
nargs = 2 if len(metavar_tuple) == 2 else 1
if sys.version_info >= (3, 9): # pragma: >=3.9 cover
nargs = 2 if len(metavar_tuple) == 2 else 1
else: # pragma: <3.9 cover
nargs = 2
elif action.nargs == argparse.ONE_OR_MORE:
nargs = 2
else: # pragma: no cover
Expand Down

0 comments on commit 1fc52ce

Please sign in to comment.