Skip to content

Commit eaac3e0

Browse files
committed
Fix the parser returning a dictionary instead of a list in the empty parse scenario
1 parent 2fa7515 commit eaac3e0

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

autoapi/_parser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ def parse_typealias(self, node):
335335
return [data]
336336

337337
def parse(self, node):
338-
data = {}
338+
data = []
339339

340340
node_type = node.__class__.__name__.lower()
341341
parse_func = getattr(self, "parse_" + node_type, None)

docs/changes/+f5e49f9f.misc.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix the parser returning a dictionary instead of a list in the empty parse scenario

tests/python/test_parser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def test_parses_all_multiline(self):
3939

4040
def test_parses_name(self):
4141
source = "foo.bar"
42-
assert self.parse(source) == {}
42+
assert self.parse(source) == []
4343

4444
def test_parses_list(self):
4545
name = "__all__"

0 commit comments

Comments
 (0)