From 150d9bab536dd0939db4c2abe94e0222bfcc97f6 Mon Sep 17 00:00:00 2001
From: Stefan Behnel <stefan_ml@behnel.de>
Date: Sun, 27 Jul 2014 22:15:05 +0200
Subject: [PATCH] fix BoolBinopNode handling in SwitchTransform

---
 Cython/Compiler/Optimize.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Cython/Compiler/Optimize.py b/Cython/Compiler/Optimize.py
index 01c90d59c..225a3798f 100644
--- a/Cython/Compiler/Optimize.py
+++ b/Cython/Compiler/Optimize.py
@@ -803,7 +803,7 @@ class IterationTransform(Visitor.EnvTransform):
             ])
 
 
-class SwitchTransform(Visitor.CythonTransform):
+class SwitchTransform(Visitor.EnvTransform):
     """
     This transformation tries to turn long if statements into C switch statements.
     The requirement is that every clause be an (or of) var == value, where the var
@@ -979,6 +979,7 @@ class SwitchTransform(Visitor.CythonTransform):
                or len(conditions) < 2 \
                or self.has_duplicate_values(conditions):
             self.visitchildren(node)
+            node.wrap_operands(self.current_env())  # in case we changed the operands
             return node
 
         return self.build_simple_switch_statement(
-- 
2.30.9