]> granicus.if.org Git - python/commitdiff
Small fix for compiler module ./. set literals.
authorGeorg Brandl <georg@python.org>
Mon, 28 Aug 2006 17:19:22 +0000 (17:19 +0000)
committerGeorg Brandl <georg@python.org>
Mon, 28 Aug 2006 17:19:22 +0000 (17:19 +0000)
Lib/compiler/transformer.py

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