From 882d16d1472353bc4609fa86673fd53cafe0eebf Mon Sep 17 00:00:00 2001 From: HoytKoepke Date: Sat, 16 Aug 2008 13:26:48 -0700 Subject: [PATCH] Annotation fix when no else clause. --- Cython/Compiler/Nodes.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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: -- 2.26.2