[pypy-commit] pypy py3k: Fixed the operator module for py3k.

prestontimmons noreply at buildbot.pypy.org
Mon Mar 12 23:33:51 CET 2012


Author: Preston Timmons <prestontimmons at gmail.com>
Branch: py3k
Changeset: r53364:b330bb71aacd
Date: 2012-03-12 21:59 +0000
http://bitbucket.org/pypy/pypy/changeset/b330bb71aacd/

Log:	Fixed the operator module for py3k.

diff --git a/pypy/module/operator/app_operator.py b/pypy/module/operator/app_operator.py
--- a/pypy/module/operator/app_operator.py
+++ b/pypy/module/operator/app_operator.py
@@ -60,7 +60,7 @@
 
 def single_attr_getter(attr):
     if not isinstance(attr, str):
-        if not isinstance(attr, unicode):
+        if not isinstance(attr, str):
             def _raise_typeerror(obj):
                 raise TypeError("argument must be a string, not %r" %
                                 (type(attr).__name__,))
diff --git a/pypy/module/operator/test/test_operator.py b/pypy/module/operator/test/test_operator.py
--- a/pypy/module/operator/test/test_operator.py
+++ b/pypy/module/operator/test/test_operator.py
@@ -115,7 +115,7 @@
 
         import operator
 
-        a = range(3)
+        a = list(range(3))
         raises(TypeError, operator.repeat)
         raises(TypeError, operator.repeat, a, None)
         assert operator.repeat(a, 2) == a+a
@@ -169,13 +169,13 @@
             def __index__(self):
                 return 5
 
-        a = range(3)
+        a = list(range(3))
         raises(TypeError, operator.irepeat)
         raises(TypeError, operator.irepeat, a, None)
         raises(TypeError, operator.irepeat, a, [])
         raises(TypeError, operator.irepeat, a, X())
         raises(TypeError, operator.irepeat, 6, 7)
-        assert operator.irepeat(a, 2L) is a
+        assert operator.irepeat(a, 2) is a
         assert a == [0, 1, 2, 0, 1, 2]
         assert operator.irepeat(a, 1) is a
         assert a == [0, 1, 2, 0, 1, 2]


More information about the pypy-commit mailing list