Author: Armin Rigo <[email protected]>
Branch: 
Changeset: r67341:e99ecdbbbcc7
Date: 2013-10-13 09:12 +0200
http://bitbucket.org/pypy/pypy/changeset/e99ecdbbbcc7/

Log:    Test and fix

diff --git a/rpython/rtyper/rint.py b/rpython/rtyper/rint.py
--- a/rpython/rtyper/rint.py
+++ b/rpython/rtyper/rint.py
@@ -251,7 +251,7 @@
         raise TyperError("not an integer: %r" % (value,))
 
     def get_ll_eq_function(self):
-        if self._opprefix is None:
+        if getattr(self, '_opprefix', '?') is None:
             return ll_eq_shortint
         return None
 
diff --git a/rpython/rtyper/test/test_rdict.py 
b/rpython/rtyper/test/test_rdict.py
--- a/rpython/rtyper/test/test_rdict.py
+++ b/rpython/rtyper/test/test_rdict.py
@@ -1009,6 +1009,16 @@
         assert self.interpret(func, [42]) == 123
         assert self.interpret(func, [2**16 - 43]) == 321
 
+    def test_dict_with_bool_keys(self):
+        def func(x):
+            d = {}
+            d[False] = 123
+            d[True] = 321
+            return d[x == 42]
+
+        assert self.interpret(func, [5]) == 123
+        assert self.interpret(func, [42]) == 321
+
     def test_nonnull_hint(self):
         def eq(a, b):
             return a == b
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to