forked from pool/python-sphinx-argparse
16 lines
757 B
Diff
16 lines
757 B
Diff
|
diff --git a/sphinxarg/parser.py b/sphinxarg/parser.py
|
||
|
index 9a6f76a..89583c6 100644
|
||
|
--- a/sphinxarg/parser.py
|
||
|
+++ b/sphinxarg/parser.py
|
||
|
@@ -154,7 +154,9 @@ def parse_parser(parser, data=None, **kwargs):
|
||
|
continue
|
||
|
|
||
|
# Upper case "Positional Arguments" and "Optional Arguments" titles
|
||
|
- if action_group.title == 'optional arguments':
|
||
|
+ # Since python-3.10 'optional arguments' changed to 'options'
|
||
|
+ # more info: https://github.com/python/cpython/pull/23858
|
||
|
+ if action_group.title == 'optional arguments' or action_group.title == 'options':
|
||
|
action_group.title = 'Named Arguments'
|
||
|
if action_group.title == 'positional arguments':
|
||
|
action_group.title = 'Positional Arguments'
|