catch ArithmeticError during constant folding => not constant
authorStefan Behnel <scoder@users.berlios.de>
Thu, 28 Jan 2010 20:42:59 +0000 (21:42 +0100)
committerStefan Behnel <scoder@users.berlios.de>
Thu, 28 Jan 2010 20:42:59 +0000 (21:42 +0100)
Cython/Compiler/Optimize.py

index a5b1378fc98b02e6475aaf8d70d7f2d687d43cf3..5936294d85a348da222fa9ddac85a4ff4260667e 100644 (file)
@@ -1757,7 +1757,7 @@ class ConstantFolding(Visitor.VisitorTransform, SkipDeclarations):
             node.calculate_constant_result()
 #            if node.constant_result is not ExprNodes.not_a_constant:
 #                print node.__class__.__name__, node.constant_result
-        except (ValueError, TypeError, KeyError, IndexError, AttributeError):
+        except (ValueError, TypeError, KeyError, IndexError, AttributeError, ArithmeticError):
             # ignore all 'normal' errors here => no constant result
             pass
         except Exception: