Skip to content

Commit ee542af

Browse files
committed
fix iterating over subContent
when trying to @replace a command group, the following exception was raised: Exception occurred: File "/usr/lib/python3.6/site-packages/sphinxarg/ext.py", line 96, in print_action_groups for k, v in subContent.items(): AttributeError: 'list' object has no attribute 'items' and later Exception occurred: File "/usr/lib/python3.6/site-packages/sphinxarg/ext.py", line 105, in print_action_groups for k, v in map_nested_definitions(subContent): ValueError: too many values to unpack (expected 2)
1 parent 2743ab2 commit ee542af

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

sphinxarg/ext.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,16 +93,17 @@ def print_action_groups(data, nested_content, markDownHelp=False, settings=None)
9393
desc.append(s)
9494
elif classifier == '@before':
9595
desc.insert(0, s)
96-
for k, v in subContent.items():
97-
definitions[k] = v
96+
if len(subContent) > 0:
97+
for k, v in map_nested_definitions(subContent).items():
98+
definitions[k] = v
9899
# Render appropriately
99100
for element in renderList(desc, markDownHelp):
100101
section += element
101102

102103
localDefinitions = definitions
103104
if len(subContent) > 0:
104105
localDefinitions = {k: v for k, v in definitions.items()}
105-
for k, v in map_nested_definitions(subContent):
106+
for k, v in map_nested_definitions(subContent).items():
106107
localDefinitions[k] = v
107108

108109
items = []

0 commit comments

Comments
 (0)