Annotation fix when no else clause.
authorHoytKoepke <none@none>
Sat, 16 Aug 2008 20:26:48 +0000 (13:26 -0700)
committerHoytKoepke <none@none>
Sat, 16 Aug 2008 20:26:48 +0000 (13:26 -0700)
Cython/Compiler/Nodes.py

index a67dffa556f474c4a025730eef63999b00aa3232..7eb3ede8faf80dd77b0e570410a6bf7ca139057b 100644 (file)
@@ -3041,7 +3041,7 @@ class SwitchCaseNode(StatNode):
     def annotate(self, code):
         for cond in self.conditions:
             cond.annotate(code)
-        body.annotate(code)
+        self.body.annotate(code)
 
 class SwitchStatNode(StatNode):
     # Generated in the optimization of an if-elif-else node
@@ -3065,7 +3065,8 @@ class SwitchStatNode(StatNode):
         self.test.annotate(code)
         for case in self.cases:
             case.annotate(code)
-        self.else_clause.annotate(code)
+        if self.else_clause is not None:
+            self.else_clause.annotate(code)
             
 class LoopNode: