[pypy-commit] pypy disable_merge_different_int_types: raise UnionError

bivab noreply at buildbot.pypy.org
Wed Nov 23 16:11:42 CET 2011


Author: David Schneider <david.schneider at picle.org>
Branch: disable_merge_different_int_types
Changeset: r49691:96f0a1fe89b1
Date: 2011-11-23 16:10 +0100
http://bitbucket.org/pypy/pypy/changeset/96f0a1fe89b1/

Log:	raise UnionError

diff --git a/pypy/annotation/binaryop.py b/pypy/annotation/binaryop.py
--- a/pypy/annotation/binaryop.py
+++ b/pypy/annotation/binaryop.py
@@ -263,18 +263,18 @@
             knowntype = t1
         elif t2 is int:
             if not int2.is_constant():
-               raise Exception, "Merging %s and a non-constant int is not allowed" % t1
+               raise UnionError, "Merging %s and a non-constant int is not allowed" % t1
             knowntype = t1
             # ensure constant int2 is in range of t1
             t1(int2.const)
         elif t1 is int:
             if not int1.is_constant():
-               raise Exception, "Merging %s and a non-constant int is not allowed" % t2
+               raise UnionError, "Merging %s and a non-constant int is not allowed" % t2
             knowntype = t2
             # ensure constant int1 is in range of t2
             t2(int1.const)
         else:
-            raise Exception, "Merging these types (%s, %s) is not supported" % (t1, t2)
+            raise UnionError, "Merging these types (%s, %s) is not supported" % (t1, t2)
         return SomeInteger(nonneg=int1.nonneg and int2.nonneg,
                            knowntype=knowntype)
 


More information about the pypy-commit mailing list