[pypy-commit] pypy py3k: Back out changeset b84f64795e2b because I referred the wrong issue in the commit message.

mjacob noreply at buildbot.pypy.org
Fri Jun 5 20:32:06 CEST 2015


Author: Manuel Jacob <me at manueljacob.de>
Branch: py3k
Changeset: r77923:5ddb9db14d38
Date: 2015-06-05 20:29 +0200
http://bitbucket.org/pypy/pypy/changeset/5ddb9db14d38/

Log:	Back out changeset b84f64795e2b because I referred the wrong issue
	in the commit message.

diff --git a/pypy/objspace/std/bytesobject.py b/pypy/objspace/std/bytesobject.py
--- a/pypy/objspace/std/bytesobject.py
+++ b/pypy/objspace/std/bytesobject.py
@@ -701,10 +701,9 @@
             raise OperationError(space.w_TypeError, space.wrap(
                     "encoding or errors without string argument"))
         return []
-    # Is it an integer?
-    # Note that we're calling space.getindex_w() instead of space.int_w().
+    # Is it an int?
     try:
-        count = space.getindex_w(w_source, space.w_OverflowError)
+        count = space.int_w(w_source)
     except OperationError, e:
         if not e.match(space, space.w_TypeError):
             raise
diff --git a/pypy/objspace/std/test/test_bytesobject.py b/pypy/objspace/std/test/test_bytesobject.py
--- a/pypy/objspace/std/test/test_bytesobject.py
+++ b/pypy/objspace/std/test/test_bytesobject.py
@@ -732,18 +732,6 @@
                 return [3, 4]
         raises(TypeError, bytes, Z())
 
-    def test_fromobject___index__(self):
-        class WithIndex:
-            def __index__(self):
-                return 3
-        assert bytes(WithIndex()) == b'\x00\x00\x00'
-
-    def test_fromobject___int__(self):
-        class WithInt:
-            def __int__(self):
-                return 3
-        raises(TypeError, bytes, WithInt())
-
     def test_getnewargs(self):
         assert  b"foo".__getnewargs__() == (b"foo",)
 


More information about the pypy-commit mailing list