Author: Antonio Cuni <anto.c...@gmail.com>
Branch: py3k
Changeset: r54412:34b63669e7da
Date: 2012-04-16 15:19 +0200
http://bitbucket.org/pypy/pypy/changeset/34b63669e7da/

Log:    py3k fixes

diff --git a/pypy/objspace/std/test/test_setobject.py 
b/pypy/objspace/std/test/test_setobject.py
--- a/pypy/objspace/std/test/test_setobject.py
+++ b/pypy/objspace/std/test/test_setobject.py
@@ -124,6 +124,7 @@
         intstr.get_storage_from_list = tmp_func
 
     def test_listview_str_int_on_set(self):
+        py.test.skip("listview_str not supported for py3k strings (i.e., 
unicode)")
         w = self.space.wrap
 
         w_a = W_SetObject(self.space)
@@ -259,7 +260,7 @@
         raises(KeyError, "b.pop()")
 
         a = set([1,2,3,4,5])
-        for i in xrange(5):
+        for i in range(5):
             a.pop()
         assert a == set()
         raises(KeyError, "a.pop()")
@@ -911,7 +912,7 @@
         it = iter(s)
         s.add(7)
         # 's' is now length 4
-        raises(RuntimeError, it.next)
+        raises(RuntimeError, it.__next__)
 
     def test_iter_set_strategy_only_change_1(self):
         s = set([1, 3, 5])
@@ -919,6 +920,8 @@
         class Foo(object):
             def __eq__(self, other):
                 return False
+            def __hash__(self):
+                return 0
         assert Foo() not in s      # this changes the strategy of 'd'
         lst = list(s)  # but iterating still works
         assert sorted(lst) == [1, 3, 5]
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to