Skip to content

Commit cf7544d

Browse files
committed
patch: assign an empty list to an empty case statement instead of None when saving AST as JSON.
1 parent ab00af8 commit cf7544d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

examples/c_json.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,8 @@ def to_dict(node):
116116
for child_attr in child_attrs_of(klass):
117117
if child_attr not in result:
118118
result[child_attr] = None
119+
if result['_nodetype'] == "Case" :
120+
result[child_attr] = []
119121

120122
return result
121123

0 commit comments

Comments
 (0)