Merge in lxml-pyrex enum patch.
authorWilliam Stein <wstein@gmail.com>
Sat, 28 Jul 2007 20:18:27 +0000 (13:18 -0700)
committerWilliam Stein <wstein@gmail.com>
Sat, 28 Jul 2007 20:18:27 +0000 (13:18 -0700)
Cython/Compiler/ExprNodes.py

index 96df5edbabba4d32f8ddbcc4e0ab3ac7d516a32c..7edea44707fc7a5bade38cc3f6e2d755e8f49aa0 100644 (file)
@@ -2478,6 +2478,10 @@ class NumBinopNode(BinopNode):
     def analyse_c_operation(self, env):
         type1 = self.operand1.type
         type2 = self.operand2.type
+        if type1.is_enum:
+            type1 = PyrexTypes.c_int_type
+        if type2.is_enum:
+            type2 = PyrexTypes.c_int_type
         self.type = self.compute_c_result_type(type1, type2)
         if not self.type:
             self.type_error()