Small fix for compiler module ./. set literals.

This commit is contained in:
Georg Brandl 2006-08-28 17:19:22 +00:00
parent 17ab9a02b5
commit b3fa66fe30

View file

@ -1185,7 +1185,7 @@ class Transformer:
def com_dictsetmaker(self, nodelist): def com_dictsetmaker(self, nodelist):
# dictsetmaker: (test ':' test (',' test ':' value)* [',']) | (test (',' test)* [',']) # dictsetmaker: (test ':' test (',' test ':' value)* [',']) | (test (',' test)* [','])
items = [] items = []
if nodelist[2] != ':': if len(nodelist) == 1 or nodelist[1] != ':':
# it's a set # it's a set
for i in range(1, len(nodelist), 2): for i in range(1, len(nodelist), 2):
items.append(self.com_node(nodelist[i])) items.append(self.com_node(nodelist[i]))