Commit c46addfa authored by Stefan Behnel's avatar Stefan Behnel

fix for dict literals that end with ','

parent 6608bae8
......@@ -761,6 +761,8 @@ def p_dict_or_set_maker(s):
values = [item]
while s.sy == ',':
s.next()
if s.sy == '}':
break
values.append( p_simple_expr(s) )
s.expect('}')
return ExprNodes.SetNode(pos, args=values)
......@@ -789,6 +791,8 @@ def p_dict_or_set_maker(s):
items = [ExprNodes.DictItemNode(key.pos, key=key, value=value)]
while s.sy == ',':
s.next()
if s.sy == '}':
break
key = p_simple_expr(s)
s.expect(':')
value = p_simple_expr(s)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment