From: HoytKoepke Date: Sat, 16 Aug 2008 20:26:48 +0000 (-0700) Subject: Annotation fix when no else clause. X-Git-Tag: 0.9.8.1~14 X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=882d16d1472353bc4609fa86673fd53cafe0eebf;p=cython.git Annotation fix when no else clause. --- diff --git a/Cython/Compiler/Nodes.py b/Cython/Compiler/Nodes.py index a67dffa5..7eb3ede8 100644 --- a/Cython/Compiler/Nodes.py +++ b/Cython/Compiler/Nodes.py @@ -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: